@@servername

  • Hello,

    my SQL Server was installed with name 'FIRSTNAME'. After that I change its name into 'SECONDNAME', with :

    sp_dropserver 'FIRSTNAME'

    sp_addserver 'SECONDNAME', LOCAL.

    But when I start:

    select serverproperty('servername')

    result is: 'FIRSTNAME'.

    Wherefrom serverproperty('servername') takes information.

  • did you restart the server ?

     


    * Noel

  • Yes I did.

    After restart @@servername shows 'SECONDNAME', but

    select serverproperty('servername') shows 'FIRSTNAME'. So, it must be written somewhere that 'FIRSTNAME'.

  • did you also alter the physical servers name ?

     

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • I did only sp_dropserver 'FIRSTNAME'

    and sp_addserver 'SECONDNAME', LOCAL.

    Nothing else.

    I wonder where serverproperty('servername') gather information

  • don't mess with systemtables  

    but how about :

    select *

    from master.dbo.sysservers

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Could you post the output of sp_helpserver ?

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • sp_helpserver gives me SECONDNAME

  • Could you post the output of sp_helpserver ? (the actual results set when you execute it from QA) ... I'm asking for a specific reason, to help you figure this out ... the exact output friom a QA session (all columns) is invaluable at times ...

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • name                         secondname

    network_name           secondname

    status                         rpc,rpc out,use remote collation     

    id                               0

    collation_name           NULL

    connect_timeout         0

    query_timeout            0

     

  • I was able to duplicate your issue on a named instance. I need to acquire a 'default' instance yet ...

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • They should report different names in some cases. See Books Online @@Servername topic:

    "......

    Although the @@SERVERNAME function and the SERVERNAME property of SERVERPROPERTY function may return strings with similar formats, the information can be different. The SERVERNAME property automatically reports changes in the network name of the computer.

    In contrast, @@SERVERNAME does not report such changes. @@SERVERNAME reports changes made to the local server name using the sp_addserver or sp_dropserver stored procedure..........."

    Regards,Yelena Varsha

  • Thanks for the information Yelana !

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

Viewing 13 posts - 1 through 12 (of 12 total)

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