Thursday, September 29, 2011

How to change instance name of sql-server

SQL Server doesn’t use the network name, it only excepts that as an alias. My SQL Server instance was still named “old_name”. I found that out by running these two queries:

1

2

sp_helpserver

select @@servername

So in order to get the network name and the SQL Server instance name back in sync I had do these steps:

1. Run this in Microsoft SQL Server Management Studio:

1

2

3

4

sp_dropserver 'old_name'

go

sp_addserver 'new_name','local'

go

2. Restart SQL Server service. I prefer the command prompt for this, but you can just as easily do it in Services under the Control Panel
net stop mssqlserver
net start mssqlserver

Then after that is done run this again, to make sure everything is changed:

1

2

sp_helpserver

select @@servername

For further detail click here

No comments:

Post a Comment

Earn Money ! Affiliate Program
Open Directory Project at dmoz.org