Friday, March 9, 2012

Join two tables from different dbs

Hi,
have to tables t1 and t2
t1 is in database db1
t2 is in db db2
Is it possible to join these two tables with an sql statement. or do i have to join my two datasets in my c#- Code
GreetzOk, can do it with 3 part naming.|||You can write the script as: Select * From DatabaseName.dbo.TableName|||select *
from db1.dbo.t1 t1 inner join db2.dbo.t2 t2
on t1.pk = t2.pk

No comments:

Post a Comment