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 Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Twitter Feed

Follow

Get every new post delivered to your Inbox.