How to: change SQL server instance name

SQL server typically gets its instance name from underlining machine name when the SQL server was first installed. If the machine name has been changed, the SQL server instance name will be in-sync with network name. It could cause lots of wired behavior. If the following two command give you different name, then you better change your instance name.
sp_helpserver
select @@servername

To change instance name run this:

sp_dropserver 'old_name'
go
sp_addserver 'new_name','local'
go

Then restart the SQL server service.

Leave a Reply

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