Day 16: @@servername is null

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

select * from sys.servers


select SERVERPROPERTY(‘servername’)


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.



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: Logo

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.