August 10, 2005 at 8:26 am
I cannot see my servername?? What should I do to add my servername into table.
when I do select * from sysservers I get blank rows???
August 10, 2005 at 8:49 am
What does this return?
Select @@ServerName
August 10, 2005 at 8:50 am
I get NULL
August 10, 2005 at 9:01 am
If it's returning NULL, you will probably have to use the sp_dropserver, and sp_addserver stored procedures to get the name back. Do this from the Master database. You're not really dropping the whole server, just the internal name. Was this server renamed at some point in the past?
My hovercraft is full of eels.
August 10, 2005 at 9:11 am
when you add the server remember to use the local paramater
sp_addserver 'yourserver', 'local'
without this you simply add a new server and you will still get null from @@servername, also is requires a sql service restart
August 10, 2005 at 9:18 am
Thanks for the feedback
1. One quick question how should I drop the servername if there in NULL value.
Can I do sp_dropserver 'NULL'
sp_addserver 'Local' ( shall I use the Local or the Windows server name)
If I do, do i need to restart the server or shall my jobs and DTS will be fine.
2. I don't know in the past if they have rename the server, if that the case what should I do???
August 10, 2005 at 9:25 am
If you query sysservers you should see an entry for your server, but it probably does not have a svrid of 0 so it wont show up as local server
if you run this code replacing yourserver with the actual name of your server and restart the sql service it should then be fine
sp_dropserver 'yourserver'
go
sp_addserver 'yourserver', 'local'
August 11, 2005 at 1:28 am
You don't need the sp_dropserver if there are no rows in sysservers.
Basically, it's one half of "renaming a server" in BOL
August 11, 2005 at 11:58 am
DOn't forget to stop/restart SQL Server ... @@servername is set on starting the server.
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
August 11, 2005 at 12:08 pm
Hehe... that's a nice gotcha!!
How much time did you lose on this one?
August 11, 2005 at 12:38 pm
none ... figured it out in v4.21a ... it's been the same ever since !
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply