Sunday, February 19, 2012

About server name and db name

Hi there,
Is there a way that I can change server name after
installing SQL 2000 database? I have tried to change my
server name, but the database server under SQL Server
Enterprise Manager still showed the old server name and
did not work at all. Is it possible to do it, since I want
to install the database as a different name first, and
then change it to the old DB server name to take place of
the old DB server? If there is a way, how?
Thanks in advance. I always get great helps here. Thanks
to all.
yunerUse the following script and then restart SQL Server:
DECLARE @.old_server_name SYSNAME
DECLARE @.new_server_name SYSNAME
SET @.old_server_name = '' -- Change names here
SET @.new_server_name = ''
IF @.old_server_name = '' OR @.new_server_name = ''
RAISERROR ('Server names not provided. Exiting now!!', 22, 127) WITH LOG
EXEC sp_dropserver @.server = @.old_server_name
EXEC sp_addserver @.server = @.new_server_name , @.local = 'LOCAL'
UPDATE msdb..sysjobs
SET originating_server = @.new_server_name
WHERE originating_server = @.old_server_name
Jacco Schalkwijk MCDBA, MCSD, MCSE
Database Administrator
Eurostop Ltd.
"yuner" <cindy_bai@.yahoo.com> wrote in message
news:079901c36be6$e039cb80$a001280a@.phx.gbl...
> Hi there,
> Is there a way that I can change server name after
> installing SQL 2000 database? I have tried to change my
> server name, but the database server under SQL Server
> Enterprise Manager still showed the old server name and
> did not work at all. Is it possible to do it, since I want
> to install the database as a different name first, and
> then change it to the old DB server name to take place of
> the old DB server? If there is a way, how?
> Thanks in advance. I always get great helps here. Thanks
> to all.
> yuner

No comments:

Post a Comment