|
|
Question : Circular referential integrity problems
|
|
I have 4 tables which are all interconnected
Table Z has a primary key PKZ Table C has a primary key PKC
Table C has a foreign key to table Z Table A has a foreign key to table C and a foreign key to table Z Table T has 2 foreign keys to table C and a foreign key to table Z
All foreign keys may be nulls in certain circumstances.
I want to enforce referential integrity on all updates but can't because of the circular relationships.
Can anyone advise how I can redesign, reindex, re-anything to get round the problem ?
|
Answer : Circular referential integrity problems
|
|
> foriegn keys can't have nulls <
Yes they can.
Mamine: don't cascade updates. If you have a proper primary key, why would you ever change it? You still want foreign keys (to make sure you don't get orphaned records), but cascading updates? Naaah.
|
|
|
|