반응형

* 다른서버의 디비의 테이블 조인

db1명@서버명:테이블명 a, db2명@서버명:테이블명 b, db2명@서버명:테이블명 c

* 같은서버의 서로 다른 디비의 테이블 조인

Select * from DB1.Table1 A, DB2.Table2 B where A.X = B.X

select x, x2, x3 from 나의디비테이블 a inner join
openrowset('sqloledb','다른서버이름'; 'sa'; 'xxxx', 'select x, x2, x3 from 다른서버이름.디비명.dbo.테이블명') as b
ON a.xx = b.xx

+ Recent posts