Hi,
anyone knows if it's possible to have relations (constraints, foreign keys) between to db's.
for example, can i have in table a from db aa, a field that have a constraint to field on table b, from db bb.
thanks
| SitePoint Sponsor |
Hi,
anyone knows if it's possible to have relations (constraints, foreign keys) between to db's.
for example, can i have in table a from db aa, a field that have a constraint to field on table b, from db bb.
thanks


In MySQL, no. It allows for table and column name only (backticks after version 3.23.50.Originally Posted by gmx2
In SQLServer2000, I believe the only way to implement this still is to have an BEFORE INSERT/UPDATE trigger query the appropriate db for existence.
I've needed this in the past, but then an (at the time) more enlightened colleague had said to me:
"If the data in one database should be constrained by the data in another database, why are there two databases at all? The definition of a database in one sense of the word is a collection of all related data..."
hth,
jay
Bookmarks