Connecting Tech Pros Worldwide Help | Site Map

query on multiple database

Newbie
 
Join Date: Aug 2008
Posts: 2
#1: Aug 19 '08
in two database ,i want to select some columns of three tables each of two databases where column name is same
Newbie
 
Join Date: Aug 2008
Posts: 31
#2: Aug 19 '08

re: query on multiple database


All databases on same server?
ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,925
#3: Aug 19 '08

re: query on multiple database


use the fullname of the object

Expand|Select|Wrap|Line Numbers
  1. SELECT ....FROM db.owner.yourtable
  2. .....LEFT JOIN anotherdb.owner.yourtable
  3.  
If they're on a different server, you might need to link those server first.

-- CK
Newbie
 
Join Date: Aug 2008
Posts: 2
#4: Aug 20 '08

re: query on multiple database


Quote:

Originally Posted by BHTanna

All databases on same server?


yes all database in same server , are you give me some solution
thanks
Reply