First collect the output of the current instance configuration. You can get the instance name stored in the SQL Server metadata.
Make sure you have backup of all the database if you are changing the production server instance name.
[sourcecode language="sql"]
sp_helpserver
select @@servername
[/sourcecode]
You can change the instance name using below query.
Default Instance
[sourcecode language="sql"]
sp_dropserver 'old_name'
go
sp_addserver 'new_name','local'
go
[/sourcecode]
Named Instance
[sourcecode language="sql"]
sp_dropserver 'Server Name\old_Instance_name'
go
sp_addserver 'ServerName\New Instance Name','local'
go
[/sourcecode]
Verify sql server instance configuration by running below queries
[sourcecode language="sql"]
sp_helpserver
select @@servername
[/sourcecode]
Restart the SQL Server Services.
[sourcecode language="sql"]
net stop MSSQLServer
net start MSSQLServer
[/sourcecode]
can we create two instances in sql server standard edition?
ReplyDeleteplz explain.
Yes we can create two instances in standard edition
ReplyDeleteHey, I found your blog while searching on Google your post looks very interesting for me. I will add a backlink and bookmark your site. Keep up the good work!
ReplyDeleteI'm Out! :)
[...] You All Very Happy and Prosperous New Year 2011Wishing you all Very happy and prosperous new yearHow to change SQL Server Instance Name?Transactions and Locks in SQL ServerDBA Roles and ResponsibilitiesNetwork Troubleshooting Dos [...]
ReplyDeletethanks a lot for this tip. It helped me a great deal.
ReplyDeleteHi Jugal,
ReplyDeleteAre there any best practices on logshipping articles
what is the best way to copy the big log files / backup files in logshipping from primary server to secondary server
Log file shouldn't be too big, if you have scenario go for compress backup. Again you can change the interval as well.
ReplyDeleteI changed the name of the instance and the sp_helpserver shows the new name but the dialog to connect to an instance still shows the old name. How do I get this to reset? I stopped and started the server instance.
ReplyDeleteCan you please check the registry as well? Is it a default instance or named instance?
ReplyDeleteThe registry has several hundred entries that match the instance name. The instance is a named instance. It looks like a lot of work that I do not have time to do. I just changed the name back to the old instance name for now.
ReplyDeleteI am trying to install sql server 2005 express,
ReplyDeleteBut the insatallation has been failed with the error message that the instance is already running.
How can i solve this?
can u help me?
Try to install the named instance...
ReplyDeleteThanks ..
ReplyDeleteIt really work but you must add 1 step to restart the server
thanks again ...