Find Fully Qualified Domain Name of SQL Server 2000 using T-SQL

  • Hi,

    I am scripting some stored procedures to be deployed to our test and later live environments, and the DBAs want us to include the grant permission statements within the same script file. I want to naturally be able to use the same script for both, but the windows service user accounts accessing them are different:

    TEST uses DEV.company.local\dbuser to connect to DEV\SQL1.company.local

    LIVE uses company.local\dbuser to connect to SQL1.company.local

    I have tried using @@SERVERNAME, but they both come back as SQL1.

    Is there a way for me to find the full domain name of the sql server using T-SQL, or will I have to use 2 versions of the script?

    Thanks

    Phil

  • Hi Phil

    Why do you need to find the full domain name in order to grant permissions?

    If the DBA compiles your script, will he not be on a session on the specified server?

    I also need to script out permissions with every script that I send to our DBAs, and we have got dev, UAT and Prod databases all running on different physical servers. Never needed to specify domain names though.

Viewing 2 posts - 1 through 1 (of 1 total)

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