Day 16: @@servername is null

When someone change the windows box name or drop the server*

select * from sys.servers

select @@SERVERNAME

select SERVERPROPERTY(‘servername’)

–sp_dropserver’aaa’

sp_addserver ‘xxx’,local

*Require service restart to get effect

the output of @@SERVERNAME & SERVERPROPERTY(‘servername’) should be same, if they are not same you replication will not work, as replication takes physical server name to communicate.

This will also directly affect the application or system which are using your physical server, so always remember when you are changing the physical box make sure to check @@SERVERNAME & SERVERPROPERTY(‘servername’)

To resolve the issue  drop the server and add the new name with given host name.

Reference:-

http://social.msdn.microsoft.com/Forums/en-US/sqldatabaseengine/thread/42fb0613-c9fe-46df-9437-bab5d9a6761b.

 

Advertisements
This entry was posted in Troubleshooting and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s