SQL跨库查询语句

select top 1 a.PersonName,isnull(a.PhoneNumber,0) PhoneNumber,a.AreaID,a.AreaName,b.CustomerName
from OPENDATASOURCE('SQLOLEDB','Data Source=192.168.0.243;User ID=sa;Password=wecome@159357').WKOMS.dbo.PubAreAssist a
left join OPENDATASOURCE('SQLOLEDB','Data Source=192.168.0.243;User ID=sa;Password=wecome@159357').WKOMS.dbo.Customer b
on a.AreaID=B.AreaID where b.Code='HN07.0159' and a.org='1001609280000268'

原文地址:https://www.cnblogs.com/jiangyunfeng/p/12837093.html