Renaming an MS SQL instance (MS SQL 2005 or higher)
This post might contain affiliate links. We may earn a commission if you click and make a purchase. Your support is appreciated!
Because I currently had the task …
A customer wanted a new server, identical to the existing test or development environment.
Background:
The customer owns a server with two instances (test and development) and now wants a server for the production environment …
Our VMWare colleagues suggest a one-to-one clone, the customer agrees.
So what about the MSSQL installations? Can you rename?
Just asked Google and received contradictory results, especially since this is not the default instance but two named instances:
At least since MSSQL 2005 there are the StoredProcedures sp_dropserver and sp_addserver, which do not necessarily indicate the function of renaming, but they fulfil the desired functions.
-– Determine the current name of the instance
SELECT @@servername
-- Remove the instance from the server list
EXEC master.dbo.sp_dropserver ‘[SERVER NAME]‘
-- Add the "new" instance as a new local server
EXEC master.dbo.sp_addserver ‘[NEW SERVER NAME]‘, ‘local’
Restarting renamed SQL Server Instance
-- checking the new instance name
SELECT @@servername
The second instance could just be uninstalled, VMWare colleagues happy, DBAs happy and customer satisfied.
This post might contain affiliate links. We may earn a commission if you click and make a purchase. Your support is appreciated!
Björn continues to work from Mexico as a Senior Consultant – Microsoft Data Platform and Cloud for Kramer&Crew in Cologne. He also remains loyal to the community from his new home, he is involved in Data Saturdays or in various forums. Besides the topics around SQL Server, Powershell and Azure SQL, he is interested in science fiction, baking 😉 and cycling.
Amazon.com Empfehlungen
Damit ich auch meine Kosten für den Blog ein wenig senken kann, verwende ich auf diese Seite das Amazon.com Affiliate Programm, so bekomme ich - falls ihr ein Produkt über meinen Link kauft, eine kleine Provision (ohne zusätzliche Kosten für euch!).
Auto Amazon Links: No products found.