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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Rename Server

Author  Topic 

joni
Yak Posting Veteran

50 Posts

Posted - 2006-11-10 : 09:15:24
Hi Gurus,

I have a server named ME1-ORION hosted in Mexico. This server will be change to another place and I will need change it name from ME1-ORION to CI1-ORION. What I need to do to solve this problem without lost my connections database.

Thanks

Joni

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-10 : 11:13:13
Do you want to rename server without loosing existing connections?

Then it's not possible because renaming server involves dropping and adding server again.

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

miranwar
Posting Yak Master

125 Posts

Posted - 2006-11-10 : 11:19:19
I'm not sure about the connections. But to change the server name you have to update syservers table on the master database with the new server name. Also to transfer your jobs you would have to update the sysjobs table on msdb. Update the column originating_server from the old server name to the new one.
Go to Top of Page

joni
Yak Posting Veteran

50 Posts

Posted - 2006-11-10 : 11:37:10
I think that I will need drop and adding server again, but my question is work well??
Go to Top of Page

miranwar
Posting Yak Master

125 Posts

Posted - 2006-11-10 : 11:48:35
After you have renamed the server in Windows:

EXEC sp_dropserver '<old_name>'
go
EXEC sp_addserver '<new_name>', 'local'
go


THEN ON MSDB:


DECLARE @srv sysname
SET @srv = CAST(SERVERPROPERTY('ServerName') AS sysname)
UPDATE sysjobs SET originating_server = @srv

If this is a target server (you have jobs sent from a master server), you have to exclude them, so you don't convert those jobs into local jobs:

WHERE originating_server = '<old_name>'
Go to Top of Page

joni
Yak Posting Veteran

50 Posts

Posted - 2006-11-10 : 13:07:36
it is simple think to do.

thanks fellows

Joni
Go to Top of Page
   

- Advertisement -