What server am I on?

  • Hi hopefully a basic question? I have a number of jobs running on diffrent servers and it would be nice instead of hard coding the server in the isql to automate it. So is there a command with returns the name of the server.

    Many thanks

  • SELECT

    @@Servername

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • many thanks

  • Also can use select serverproperty('servername')

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

Viewing 4 posts - 1 through 3 (of 3 total)

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