-- 删除链接服务(如果它已经存在) if exists(select null from sys.servers where name = @linkedServerName) begin exec sp_dropserver @server = @linkedServerName, @droplogins = 'droplogins' end
if exists(select null from sys.servers where name = @linkedServerName) begin exec sp_dropserver @server = @linkedServerName, @droplogins = 'droplogins' end