select * from opendatasource('sqloledb','Data Source=(local)/SQLEXPRESS;Initial Catalog=amwhm6_release;User ID=sa;Password=1').amwhm6_release .dbo.mst_chkData_Biopulsar_rpt_1_temp
insert into opendatasource('sqloledb','Data Source=DENGYU/SQLEXPRESS;Initial Catalog=amwhm6_release;User ID=sa;Password=1).amwhm6_release .dbo.mst_chkData_Biopulsar_rpt_1select * from mst_chkData_Biopulsar_rpt_1
update opendatasource('sqloledb','Data Source=DENGYU/SQLEXPRESS;Initial Catalog=amwhm6_release;User ID=sa;Password=1).amwhm6_release .dbo.mst_chkData_Biopulsar_rpt_1 set tstorderno=c.tstorderno from mst_chkdata_ett as c , opendatasource('sqloledb','Data Source=DENGYU/SQLEXPRESS;Initial Catalog=amwhm6_release;User ID=sa;Password=1).amwhm6_release .dbo.mst_chkData_Biopulsar_rpt_1 as a where c.tstorderno =a.tstorderno
本文介绍了一种使用SQL的opendatasource功能进行跨服务器数据库间的数据选择、插入及更新的方法。通过具体实例展示了如何从一个数据源选择数据并插入到另一个数据源中,同时还演示了如何更新目标数据源中的特定记录。
3728

被折叠的 条评论
为什么被折叠?



