Loading . . .
Renaming an MS SQL instance (MS SQL 2005 or higher)

Renaming an MS SQL instance (MS SQL 2005 or higher)

Because I currently had the task …
A customer wanted a new server, identical to the existing test or development environment.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Next post Instant File Initialization – possible Performance Increasement

SQL from Hamburg

Das bin ich ;-)

Björn Peters - MVP - Data Platform
I had to do with MS SQL databases for the first time in 2000 and looked after these database systems for around seven years. From 2007 to 2019, I was employed as a database administrator and looked after many different SQL servers from medium-sized companies and large corporations from different industries.
Although I have some certificates, I get my insights and knowledge about the SQL Server purely from day-to-day business, reading / following numerous forums/blogs.
I'm not specialized in any topic, but I focus mostly on performance analysis.
Since the end of 2016, I have been the Azure Meetup Hamburg organizer and from April 2017 to June 2018, Cloud and Data Center Management MVP, and since July 2018, Data Platform MVP.