October 26, 2009 at 10:44 am
Hi Everyone,
One of our old server is returning NULL for serverproperty('InstanceName'). I have used sp_addserver with new name and restarted the server but there is no effect. Can some one suggest how to change the name of the server when old name is not known.
ta
October 26, 2009 at 11:18 am
For it to take effect, you have to set it with
sp_addserver 'YourServername', 'LOCAL'
and then restart the SQL Services
(note: for some reason last time I had to do it, it only worked by using the uppercase LOCAL)
did you do the sp_dropserver before as well?
October 26, 2009 at 11:21 am
Try Select @@Servername
That *should* give you the server name, SELECT serverproperty('InstanceName') gives me null on a couple of machines.
October 26, 2009 at 11:40 am
October 26, 2009 at 2:57 pm
Hi Ronnie,
@@servername also returned NULL. I have used addserver with out 'Local' option. Will try that and will update the post accordingly.
October 27, 2009 at 1:16 am
Try SERVERPROPERTY('ServerName'). See BOL ---> SERVERPROPERTY for the possible output.
SERVERPROPERTY('InstanceName') may also return NULL if you work on the default instance (besides invalid input, etc). But I think that you're using the wrong function...
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply