Monday, July 27, 2015

Select data of a table from another database in SQL Server 2008R2

In this short snippet blog I’ve demonstrate a condition to use two databases / schemas on the same database server, you can query across databases with the given below syntax :

  1: select * from database1.dbo.table1 t1 join database2.dbo.table2 t2 on t1.column_Name= t2.column_Name
e.g. select * from DBEncrypt.[dbo].TestTable
 
image
 
Sachin Kalia

0 comments :

Post a Comment