20160712001 SQL server R2 更名

use master
go
select @@servername;
select serverproperty('servername')

 

sp_dropserver 'BPM-SERVER'
go
sp_addserver 'BPM','local'


__________________________________________________________________


use master
go
select @@servername
select serverproperty('servername')

select * from msdb.dbo.MSdistpublishers
DELETE FROM msdb.dbo.MSdistpublishers
select * from msdb.dbo.MSdistpublishers
exec sp_droplinkedsrvlogin 'BPM-SERVER',null
exec sp_dropserver 'BPM-SERVER', 'droplogins'

USE master
 GO
 if serverproperty('BPM') <> @@servername 
begin 
       declare @server sysname 
       set   @server = @@servername 
       exec sp_dropserver @server = @server 
       set   @server = cast(serverproperty('BPM') as sysname) 
       exec sp_addserver @server = @server , @local = 'LOCAL' 
end


sp_dropserver 'BPM-SERVER'
go
sp_addserver 'BPM','local'


__________________________________________________________________

posted @ 2016-07-12 14:54  追逐苦痛  阅读(169)  评论(0编辑  收藏  举报