-- and @@SERVERNAME still returns name of old server
use master
go
SELECT @@SERVERNAME, SERVERPROPERTY('MachineName')
GO
SELECT [server_id]
,[name]
,[product]
,[provider]
,[data_source]
FROM [master].[sys].[servers]
GO
sp_dropserver 'OLDSERVER\OLDINSTANCE';
GO
sp_addserver 'NEWSERVER\NEWINSTANCE', local;
GO
-- has been updated in servers table
SELECT [server_id]
,[name]
,[product]
,[provider]
,[data_source]
FROM [master].[sys].[servers]
GO
-- may need to restart instance
-- for it to take effect for @@SERVERNAME
GO
No comments:
Post a Comment