Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
SQLDiva
Starting Member
26 Posts |
Posted - 2006-08-01 : 14:35:48
|
Hello -I have a job that runs nightly ( reports back all the space on all drives on my server ) that uses the following code:SELECT @Server = srvnameFROM master..sysServerswhere srvid = 0At one time, this ran fine. Now, this returns nothing. There is no row for the actual server I'm running on. All the servers listed have isremote = 1.Any ideas? This is a piece of legacy code from a previous developer (hey, Derrick, you mean old dba, that's you!). Ann |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2006-08-01 : 15:04:05
|
You might try using this instead:select @server = serverproperty('servername')If that doesn't work then this should get your current code working:exec sp_addserver @server = '<YourServerName>' ,@local = 'local' ,@duplicate_ok = null Be One with the OptimizerTG |
 |
|
SQLDiva
Starting Member
26 Posts |
Posted - 2006-08-03 : 10:41:20
|
Thank you, the sp_addserver worked perfectly. I knew there had to be something, and I just couldn't find it. Thanks.Ann |
 |
|
|
|
|