Thursday, February 2, 2012

Change the name of the SQL Server


Sometimes it comes up that we need to change the name of the SQL Server. Below is a quick and dirty checklist on how to accomplish this task. I feel certain there are several iterations of this all over the Internet – now there is one more .

not a science project


1. Open SQL Server Management Studio and click New Query.

2. Type Select @@ServerName to find out the current server name. In our example, we’ll be changing the server name from RKF to REH.

3. Next, type sp_dropserver ‘RKF’

4. You are now ready to add the correct name by typing sp_addserver ‘REH’.

5. Stop sql server and the sql server agent by opening a command prompt and typing net stop mssqlserver.

6. Restart SQL server by typing net start msssqlserver.

7. Restart SQL server agent by typing net start sqlserveragent.

8. Click New Query in SQL Server Management Studio and type select @@servername to verify everything is correct and you have successfully changed the sql server name.

Until next post!


1 comment:

Mariano Gomez said...

Keep in mind that changing the name of SQL Server will affect Microsoft Dynamics GP user's ability to log in. What I do in these cases is run the capture logins script, then rerun after I have changed the name of SQL Server. The capture logins script can be found as part of the KB articles on transferring Microsoft Dynamics GP from one SQL Server to another.

Mariano Gomez, MVP