SQL跨域连接更新查询

select * from OPENDATASOURCE(
'SQLOLEDB',
'Data Source=192.168.0.202;User ID=sa;Password=sasa'
).[Chy_New].dbo.SysAuthityInfo
set IDENTITY_INSERT SysAuthityInfo ON
Insert into SysAuthityInfo (AuthityId,StaffId,BtnID,DeleteFlag,CreateUser,CreateDate,UpdateUser,UpdateDate)
select AuthityId,StaffId,BtnID,DeleteFlag,CreateUser,CreateDate,UpdateUser,UpdateDate
from OPENDATASOURCE(
'SQLOLEDB',
'Data Source=192.168.0.202;User ID=sa;Password=sasa'
).[Chy_New].dbo.SysAuthityInfo
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure

posted @ 2014-01-02 09:53  袁成成  阅读(320)  评论(0编辑  收藏  举报