Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2007
    Posts
    35

    Unanswered: 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.

    Thanks

  2. #2
    Join Date
    Dec 2002
    Posts
    1,245
    What 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
    Have you hugged your backup today?

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Code:
    SELECT datasource
       FROM master.dbo.sysservers
       WHERE  0 = srvid
    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •