Get the right @@servername…@ss

Ok, so lots of server renaming goes on where i work, we have some sort of compulsive renaming disorder.

Some of you might notice that you can rename a server at the operating system level and due to name resolution everything seems to work…? Right?

Remember that we as DBAs are so elite that we operate at a different level.

Run this query to make sure everything is aohk. SELECT @@servername

Hopefully you’ll see what you want…but if you dont you need to fix it. This will cause things like…log shipping to fail.

If not you need to run

sp_dropserver ‘CURRENT@@SERVERNAMEVALUE’
sp_addserver ‘THEREALSERVERNAMEVALUE’, local

Then restart sql server service, check @@servername again.

Cheers

Leave a Reply

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