I am using an Amazon AWS SQL Server 2008 R2 server for dev purposes. In order to follow a new naming convention, we changed the name of the host. I then tried to let SQL Server know about this server name change, with the usual:
EXEC sp_dropserver '<oldname>' GO EXEC sp_addserver '<newname>', 'local' GO
But then SQL Server complains that server oldname does not exist.
When I do this: select @@SERVERNAME
I get back a host name that starts with 'IP-' and is then followed by some hex. Apparently Amazon does some funky DNS aliasing of some sort behind the scenes and comes up with its own internal name, even if I am using oldname and SQL Server itself thinks its oldname.
How do I let SQL Server know that the name of the server is now newname?