Rename a SQL 2000 or 2005 Server

I’ve had to do this on occasion and it was worth bookmarking. As well, there is more to considering renaming a SQL Server than just SQL or Windows.

If you just rename a SQL Server, SQL will bitch … so here are the basics to be done … (as well as checking logs, modifying backups, modifying antivirus clients and accounting for any other application/software that might be installed on the machine) – ie. there is a significant amount of ‘other’ things that will need attention besides SQL and the name change.

1. Ensure you have a recent and FULL backup of the server and SQL
2. Rename Server (follow appropriate naming rules and considerations for Active Directory)
3. After you change the server name and reboot SQL Server will automatically detect that you’ve changed the server name and then fix itself”. All you’ll have to do is connect to the new server name in Query Analyzer and run the following command:
— sp_dropserver ‘old server name’
— sp_addserver ‘new server name’, ‘local’
4. Finally, delete the entry in Enterprise Manager for the old server name and add in the new server
5. Turn 360 degrees to the left, do two deep knee bends and shout ‘Yoko killed the Beatles’ 3 times

Some reference materials and gotchas (besides AV, backups, etc.) to consider:
— Microsoft Technote for renaming SQL 2005 – same procedure applies for SQL 2000 – http://msdn2.microsoft.com/en-us/library/ms143799(SQL.90).aspx
— Knowledge base references – http://support.microsoft.com/kb/303774/en-us, http://support.microsoft.com/kb/281642/en-us, http://support.microsoft.com/kb/317241/en-us