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