1 Star2 Stars3 Stars4 Stars5 Stars (Aucun Vote)

[TIPS] – SQL Server: how to rename the @@SERVERNAME of your SQL instance


Little “tips” to end the day, we will see how to rename the variable @@SERVERNAME of your SQL instance. If like me, once your SQL Server deployed, optimized as it should and ready to do battle with your developers, you notice that the server name does not match the “naming Charter” business…

You have two choices, first you can decide to format everything and start from scratch, or you can change the names properly 🙂

Yes, it is possible to rename it once SQL Server installed :

  1. Out the AD server
  2. Rename the server
  3. Integrate the server with your AD
  4. Follow the procedure below for SQL

Since SSMS, run the following query to check the value of @@SERVERNAME:

Then enter the following commands:


Restart the SQL  instance from SSMS (right click on the instance and then restart) and control by typing the first command again.

If all goes well your SQL instance has now the good server name.

Jérémy Lebon
Fondateur de sys-Advisor.com, Ingénieur de production Informatique dans l'e-commerce mais passionné avant tout, je partage mon quotidien à travers ce site. #sysadmin #microsoft #vmware #tech #geek @sysadvisor Contact Skype Enterprise : jeremy.lebon@sys-advisor.com


Please enter your comment!
Please enter your name here