Rename a computer that hosts a standalone instance of SQL Server

To Check what the host name is currently according to SQL Server:

SELECT @@SERVERNAME AS 'Server Name'

For a renamed computer that hosts a default instance of SQL Server, run the following procedures:

sp_dropserver '<old_name>'
GO
sp_addserver '<new_name>', local
GO

Restart the instance of SQL Server.

For a renamed computer that hosts a named instance of SQL Server, run the following procedures:

sp_dropserver <'old_name\instancename'>
GO
sp_addserver <'new_name\instancename'>, local
GO


Restart the instance of SQL Server.

Basic check to ensure change has worked:

SELECT @@SERVERNAME AS 'Server Name'

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

%d bloggers like this: