SQL OPEN Query Sample

select * from emp.dbo.users where status='A' and empType = 'PeopleSoft' and empid not in (
select empid from OPENQUERY(Linked_SERVER_NAME, 'SELECT empid FROM CorporateDir C , Location_Info L where C.status="A" and C.empType="PeopleSoft" and C.locationID=L.location and L.country="USA";'));


查看LINKED_SERVER_NAMME:

SQLSERVER  企业管理器 ---> 控制台 ---> SQL Server group
          ---> Database--->Security--->Linked Servers.


你可能感兴趣的:(sql,C++,c,SQL Server,C#)