Tuesday, February 3, 2009

Just Too Techy - Half Man/Half Geek: Lifesaver: Renaming a SQL Server 2005

Just Too Techy - Half Man/Half Geek: Lifesaver: Renaming a SQL Server 2005: "This one has saved my bacon a few times.

I usually do test installs of whatever I'm doing at the tiem with VM - most of the time I am able to restore these installs to the client environment. But I always forget to change the machine name. Once I do I get weird issues with the SQL Server if there is one installed. I always forget the SQL format for chnaging the name of the default instance of the server which is based on the machine name. So here it is so I don't forget it and you can use it:

sp_dropserver
GO
sp_addserver , local
GO



To find out the existing name of the server (before and after) execute the following:

select @@SERVERNAME



Then restart the SQL Server."

This one saved me!!!

No comments: