不好意思 我这个跨得有点远了
IF EXISTS(SELECT * FROM master.dbo.sysservers srv WHERE srvid!=0 AND ltrim(srvname)= N'SRV_OA')
begin
Exec sp_droplinkedsrvlogin 'SRV_OA',null
Exec sp_dropserver 'SRV_OA'
end
exec sp_addlinkedserver 'SRV_OA','','sqloledb','链接地址'
exec sp_addlinkedsrvlogin 'SRV_OA','false',null,'登陆账号','登陆密码'