select @@servername

  • Where is the information for this stored? The server being returned is not the server name it is now. I am assuming someone renamed this prior to me working on it. I don't see the value returned from @@servername stored in the sysservers table so I can't sp_dropserver. I am trying to install some backup software and the install is failing and it looks to be for this reason.

  • Try restarting the services (server and maybe agent too).  That will solve this 99% of the time.

  • Hello,

    If ypu do not see the server name running @@servername, you should restart SQL service.

    Then it should be OK.

  • Check the sysservers table in master.  srvid = 0 is the local server instance.

    To change it should be able to use sp_dropserver and sp_addserver, but make sure to check this out thoroughly before you do it.

  • If the server name has been changed the @@Servername returns the old server name.  Look into BOL for sp_addserver for adding local server.

    Good day,

    Bulent

  • the restart worked. thanks.

  • In the future, you can use this:

    select

    serverproperty('servername')

    It immediately recognizes changes to the network name of the server, whereas @@servername is cached, so it requires service restarts to recognize changes.

    ** Thanks to Sujoy P. Paul in his book "Pro SQL Server 2005 Replication"

    Hope it helps!

    Carter



    But boss, why must the urgent always take precedence over the important?

  • Thanx for this: select serverproperty('servername')

    Took me 20min of searching the forums, but finally found what I was looking for,

    this works great

    thx again

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply