日期:2014-05-17 浏览次数:20500 次
exec sp_addlinkedserver 'link','','SQLOLEDB','192.168.1.4'
exec sp_addlinkedsrvlogin 'link','false',null,'sa','******'
------添加链接服务器
declare @depid1 varchar(50)
set @depid1='p1000'
select * FROM openquery(link,'SELECT * FROM database.dbo.james_dep where depid='+@depid1+'')