Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename a sql server instance

Tags:

sql-server

Is it possible to change a sql server instance name? Or is it something that can only be set during installation?

like image 862
Blankman Avatar asked Dec 01 '08 20:12

Blankman


2 Answers

To the best of my knowledge, they can only be changed at install time. You might be able to change the name with the installer package while keeping the current info. I would make backups of all of your databases and then try this.

On another note, changing instance names will just cause you so many headaches. Even if you can do it, I would strongly reccomend leaving well enough alone.

like image 87
Charles Graham Avatar answered Oct 07 '22 00:10

Charles Graham


You can't rename the instance but you can rename a server (sql2000 only) - does that help at all?

Have a look at:

sp_dropserver 'oldname', 'droplogins'

and then;

sp_addserver 'newname', local

Be aware that if there are any jobs running on that server they'll need to be renamed too;

use msdb
go

update sysjobs set originating_server = 'newname'

You'll need to restart your SQL Server

like image 37
Stuart Helwig Avatar answered Oct 07 '22 01:10

Stuart Helwig