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

0 Flares Filament.io 0 Flares ×

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.

Posted in SQL Server 2016 (EN) and tagged .
Jérémy Lebon
Co-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 @sysadvisorContact Skype Enterprise : jeremy.lebon@sys-advisor.com


Leave a Reply

You have to agree to the comment policy.