Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Instance name in SQL Server

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.

like image 913
Sergii Avatar asked Jan 11 '11 09:01

Sergii


People also ask

Can we change instance name in SQL Server?

servers. The following steps cannot be used to rename an instance of SQL Server. They can be used only to rename the part of the instance name that corresponds to the computer name. For example, you can change a computer named MB1 that hosts an instance of SQL Server named Instance1 to another name, such as MB2.

How do I change database instance name?

To rename a DB instance, use the AWS CLI command modify-db-instance . Provide the current --db-instance-identifier value and --new-db-instance-identifier parameter with the new name of the DB instance.

Can we change the instance name?

Please keep in mind that we cannot change complete name of SQL Server named instance. Suppose you have installed a named instance SERVERNAME\DBInstance1 on your server. If you want to rename this named instance then we can only change first part of this name i.e. SERVERNAME.


1 Answers

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
like image 172
Alex Avatar answered Sep 28 '22 23:09

Alex