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

Linking Databases

Status
Not open for further replies.

dom24

Programmer
Aug 5, 2004
218
GB
Could someone tell me how I link between tables in 2 different databases? I'm using SQL server 7 for both databases.

Thanks,
 
SELECT *
FROM Database1.dbo.Table1 as t1
JOIN Database2.dbo.Table2 as t2
ON (t1.ID = t2.ID)

ID used above would be the field(s) you are linking/joining the tables on.


Thanks

J. Kusch
 
No sorry, I want to link them using constraints or something so that when one table is updated the other works from the new data.
I have a staff table in an evaluation database, then a booking table in a room booking database and I want to link the 2 tables on staffno.
 
The you are probably looking for a trigger. Though cross database operations are not fun or encouraged.

Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top