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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relation with tables from another Database

Status
Not open for further replies.

omauri

Programmer
Jan 24, 2001
12
0
0
CO
Hi. I want to relation one table with another one from other database (Do not import table). How Can I do that? Thank you
 
You can JOIN tables in different databases. You cannot establish relations between tables in different databases with foreign keys.

Join Example:

Select
e.EmpName, e.EmpJob, e.EmpGrade,
a.EquipID, a.CheckoutDate
--table in current database
From dbo.Employees e
--table in another database
Join Assets.dbo.EquipmentUse a
On e.EmpID=a.EmpId Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top