Thursday, February 9, 2012

@@servername returns NULL

I am trying to script out the creation of database scripts. I am trying
to use @.@.servername in the statement. I found out the select
@.@.servername returns NULL. I used sp_dropserver to drop any servernames
first, restarted SQL, ran sp_addserver 'servername' to add the
servername, restarted SQL. select @.@.servername still returns NULL...

Any ideas why this may be happening?

Thanks,

TGru

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!tgru (tgru@.devdex.com) writes:
> I am trying to script out the creation of database scripts. I am trying
> to use @.@.servername in the statement. I found out the select
> @.@.servername returns NULL. I used sp_dropserver to drop any servernames
> first, restarted SQL, ran sp_addserver 'servername' to add the
> servername, restarted SQL. select @.@.servername still returns NULL...
> Any ideas why this may be happening?

Did you specify 'local' as the second parameter to sp_addserver?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Erland is the man!!

Thanks, I battle syntax on a daily basis...

TGru

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

No comments:

Post a Comment