程序员人生 网站导航

LinkedServer 连接服务器的使用

栏目:Sqlserver时间:2014-03-01 14:33:29
if not exists (select * from master.dbo.sysservers where srvname='srv_kaoqindb')
begin
exec sp_addlinkedserver 'srv_kaoqindb','','SQLOLEDB','168.0.0.1'
exec sp_addlinkedsrvlogin 'srv_kaoqindb','false',null,'sa','sa'
end

insert into employee (sbzno, ygname)
select sbzno, ygname
from srv_kaoqindb.kaoqindb.dbo.V_Tolocal_employee
------分隔线----------------------------
------分隔线----------------------------

最新技术推荐