470,619 Members | 2,077 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,619 developers. It's quick & easy.

@@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!
Jul 23 '05 #1
2 7782
tgru (tg**@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, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #2
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!
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Rene van Hoek | last post: by
1 post views Thread by Suresh | last post: by
2 posts views Thread by Jeff Adams | last post: by
1 post views Thread by js | last post: by
6 posts views Thread by Peter Michaux | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.