How to correctly rename a default instance of SQL Server 2005


After we did a migration from an earlier version of SQL to a new server we needed to rename the Windows server to match the old one.

It does actually seem to rename the SQL instance when you open SQL SSME but there is an extra step to complete fully:

Run the following in Query Analyser:

SELECT @@SERVERNAME

Which will return the old name of your SQL Server

Then using the quotes if needed (esp if your server name includes a hyphen) :

sp_dropserver ‘old server name’
GO
sp_addserver ‘new server name’, ‘local’
GO

Run SELECT @@SERVERNAME again should return the name of the correct server

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

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 )

Google+ photo

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

Connecting to %s