declare @s1 varchar(50)
declare @s2 varchar(50)
select @s1 = @@servername, @s2 = CONVERT(sysname, SERVERPROPERTY('servername'));
print @s1
print @s2
if @s1 != @s2 begin
exec dbo.sp_dropserver @s1
exec dbo.sp_addserver @s2, 'LOCAL'
end
网友评论