Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
wanni
Starting Member
14 Posts |
Posted - 2006-06-02 : 22:02:19
|
I have two database, db1 and db2, I can only make one connectino to sql server, how do I get data from both db1 and db2 in 1 sql query ? |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-06-03 : 00:17:14
|
[code]select *from db1.dbo.tb1 t1 inner join db2.dbo.tb2 t2on t1.col1 = t2.col2[/code] KH |
|
|
wanni
Starting Member
14 Posts |
Posted - 2006-06-03 : 06:33:00
|
quote: Originally posted by khtan
select *from db1.dbo.tb1 t1 inner join db2.dbo.tb2 t2on t1.col1 = t2.col2 KH
thanks !! |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-05 : 04:17:57
|
Provided that they are in the same Server. If DBs reside in other Server, you need to make use of Linked ServerMadhivananFailing to plan is Planning to fail |
|
|
|
|
|