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