How to Change Your SQL 2008 Database Instance Name

So with a little hunting and SQL queries I found out that SQL Server doesn’t use the network name, it only excepts that as an alias. My SQL Server instance was still named “old_name”. I found that out by running these two queries:

1 sp_helpserver
2 select @@servername

So in order to get the network name and the SQL Server instance name back in sync I had do these steps:

  1. Run this in Microsoft SQL Server Management Studio:
    1 sp_dropserver 'old_name'
    2 go
    3 sp_addserver 'new_name','local'
    4 go
  2. Restart SQL Server service. I prefer the command prompt for this, but you can just as easily do it in Services under the Control Panel
    net stop mssqlserver
    net start mssqlserver

Then after that is done run this again, to make sure everything is changed:

1 sp_helpserver
2 select @@servername

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.