Friday, March 9, 2012

Get the old SQL servername

I recall a method to get the old servername of a SQL server but old age has gotten to me.
I suspect a particular server has been renamed at one point. Obviously it wasn't me and the person before me is not around for me to ask.
So, can someone help an old guy out?

The results of print @.@.servername is NULL.

ThanksWhat OS? Which version of SQL?

If @.@.SERVERNAME is null it usually means that the sysservers entry is missing.

I'm not positive where to look for the old name, but a good place to start would be the registry. Look in HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\InstalledInstances.

Regards,

hmscott|||SELECT datasource
FROM master.dbo.sysservers
WHERE 0 = srvid-PatP

No comments:

Post a Comment