我编写了如下语句,查询结果也正常。 ------------------------ use my_data ------------------------ select * into #tmp5 from OPENROWSET('SQLOLEDB','192.168.0.120';'sa';'abc191',' select a.id_my, a.my_bh, b.* from sql_2012.dbo.mt_table a left outer join sql_2012.dbo.mt_ccb b on a.id_my=b.id_my where b.leib <= 10') ------------------------ select a.*, b.* from #tmp5 a left outer join mt_ggh b on a.id_my=b.id_my where a.id_my>'20120001' ------------------------ drop table #tmp5 ------------------------
------------------------ use my_data ------------------------ select * into #tmp5 from OPENROWSET('SQLOLEDB','192.168.0.120';'sa';'abc191',' use sql_2012 select a.id_my, a.my_bh, b.* from mt_table a left outer join mt_ccb b on a.id_my=b.id_my where b.leib <= 10') ------------------------ select a.*, b.* from #tmp5 a left outer join mt_ggh b on a.id_my=b.id_my where a.id_my>'20120001' ------------------------ drop table #tmp5 ------------------------