7

Is it posible to change instance name in SQL SERVER? Now I have ./MSSQLR2 and I would like ./SQLEXPRESS. I was trying to do this through this commands

--sp_dropserver 'HYDROGEN\MSSQLR2';
--sp_addserver 'HYDROGEN\MSSQLR2', local;

and then restart server, but It seems not work.

2
  • What's the business value for you to change instance name? It seldom affects application or design. Commented May 10, 2014 at 17:31
  • 1
    One reason is when everyone else on a team has their instance set one way, and yours is another, there is thrashing of changes to the connection string between code check-ins. It further makes me appreciate the previous job where we had a dedicated SQL development server. (Minimize differences in environments.) Commented Mar 24, 2021 at 16:13

2 Answers 2

7

For future reference, sp_dropserver and sp_addserver can only be used to rename the part of the instance name that corresponds to the computer name. So you could use it to rename your server name HYDROGEN to HELIUM, but you can't change the instance name MSQSQLR2 without reinstalling (see Jerome Bradley's answer). For details can be found on MSDN.

sp_dropserver 'HYDROGEN\MSSQLR2';
GO
sp_addserver 'HELIUM\MSSQLR2', local;
GO
Sign up to request clarification or add additional context in comments.

Comments

-2

You can create instance aliases: http://www.mssqltips.com/tip.asp?tip=1620

3 Comments

You can, but I don't think you should. See this answer from Remus.
The referenced "answer from Remus" has been removed as of at least Dec 2014.
I couldn't, it didn't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.