opendatasource问题

       EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', 1
GO
RECONFIGURE
GO

update t_csi set collectStatu='1' where csinumber in(
SELECT   csinumber
FROM      OPENDATASOURCE(
         'SQLOLEDB',
         'Data Source=***-server;User ID=sa;Password=sa'
         ).ylbx.dbo.t_csi where collectStatu='1')
GO

 

 

select * from t_person where P_Name ='葛香芬' select * from T_DataPhoto where PersonID=101270

begin tran update T_DataPhoto set Data=b.data,  Data_All=b.data_all from( select * from OPENDATASOURCE(          'SQLOLEDB',          'Data Source=zdyf-s-0103;User ID=sa;Password='          ).ylbx.dbo.t_dataphoto where personid=10077          )b          where T_DataPhoto.PersonID=101270                   rollback

你可能感兴趣的:(dataSource)