Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

How to Change the SQL Server Name after Renaming the Windows Host

By Shashank Srivastava,

When we change the name of the windows machine on whom the SQL Server is running, the SQL server name does not reflect this change. We need to manually add the new server name and remove the old server name.

Example

We have changed the windows machine name from Ahsi-PC to Shashank but when we look for the SQL Server name it will give the old windows machine name. You can see this in the image below. The new name is listed in Object Exporer, but the old name appears on the right as the result of the query.


To correct this, we need to first run sp_dropserver 'Old server Name' in the master database.


Next, we run sp_addserver 'New server name','local' in the master database. After running this, restart the SQL Server services.


Now check the new name of the instance by running select @@servername.


The SQL instance name has been changed and matches the windows name change.

The minimum rights required to perform this action are in the setupadmin server role.

Total article views: 6843 | Views in the last 30 days: 6
 
Related Articles
FORUM

Machine Name Change

If machine name changes will database keep working

FORUM

How to change Windows Authentication to Sql Server Authentication

How to change Windows Authentication to Sql Server Authenticati

FORUM

SQL Server 2005 Ghost in the Machine

Administration, Setup, Server Change

FORUM

Changed my app connection string from windows to SQL Server authentication

Changed my app connection string from Windows to SQL Server authentication

BLOG

Connecting Windows Server 2003 VM To External Network In Hyper-V

The Windows 8 and Windows Server 2012 SP1 Virtual Machines on my laptop are connecting just fine to ...

Tags
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones