if exists(select 1 from master..sysservers where srvname='CNT_DQL_2') exec sp_dropserver 'CNT_DQL_2', 'droplogins' go EXEC sp_addlinkedserver 'CNT_DQL_2', '', 'SQLOLEDB', '192.168.2.5' --'DRIVER={SQL Server};SERVER=ServerMachinName;UID=sa;PWD=password;' GO exec sp_addlinkedsrvlogin 'CNT_DQL_2', 'false', null, 'sa', '********' select * from terminal.it_ifs_sha.dbo.exinv if exists(select 1 from master..sysservers where srvname='CNT_DQL_2') exec sp_dropserver 'CNT_DQL_2', 'droplogins' go
[SQL Server] 连接其他服务器上的数据库 AddLinkedServer
最新推荐文章于 2024-02-26 13:35:59 发布