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 |
|
akalehzan
Starting Member
21 Posts |
Posted - 2007-07-02 : 17:57:18
|
| Hi all,How can I run select statement for two tables that are on two different databases?Let's say I have a SQL server 2005 on Windows 2003 server.On this SQL server 2000 I have two databases.Let’s say DB1 and DB2. On db1 I have Tbale1 and on DB2 I have Table2.I like to run a select statment:Select Table1.*, Table2.* from Table1, Table2Where table1.id = Table2.idAnd Table1.user_name like '%jim%'Both tables have same architecture.Thanks for any help.Abrahim |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-07-02 : 18:01:30
|
| select *from db1.dbo.Table1 t1inner join db2.dbo.Table2 t2on t1.id = t2.idwhere t1.user_name like '%jim%'Tara Kizerhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
akalehzan
Starting Member
21 Posts |
Posted - 2007-12-08 : 02:38:05
|
| Thanks Tara,Abrahim |
 |
|
|
|
|
|