Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Joining two tables from different databases 1

Status
Not open for further replies.

shyamal

Programmer
Aug 14, 2000
79
US
How would one join tables from different databases:
dbo.Service\ table name CPI\ field name: cpi_number
dbo.Daisy table name Fund \field name: loan_number

CPI_number and loan_number are the same, just called differently in the two tables. I need to find the common loan numbers from both tables in different databases.

Thanks in advance,
Shyamal





 

Joins are the same. Just need to fully qualify or name the tables using dbname.owner.table format.

SELECT ...
FROM dbo.Service.CPI c
INNER JOIN dbo.Daisy.Fund f
ON c.cpi_number=f.loan_number Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
Thanks Terry what worked was the following...just a few small modifications:

SELECT cpi_number
FROM Servicing.dbo.cpi c
INNER JOIN Daisy.dbo.fund f
ON c.cpi_number=f.loan_number

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top