Relationship Semantics...

JaedenRuiner

Well-known member
Joined
Aug 13, 2007
Messages
340
Programming Experience
10+
Well,

I've dealt enough with databases to know a few things but every now and then the semantics is confusing as to what means what. Working with two tables, one primary one child, in a standard 1 to many relationship, I'm thinking about the differences between relationship types and wondering if i've got it set up right.

There is the Update Rule and Delete rule and I understand those, but the "Enforce Foreign Key Constraint", does that mean that I cannot have an entry in the child table unless the FK matches one in the parent table?

Basically, I'm wondering how I would set up a relation that will exist on child entries that are set, but otherwise I want the abilty to have child record's FK_Column set to NULL. so that Child entries can exist without being paired to a parent entry, while still maintaining the benefits of the cascade rules when they apply.

Thanks
 
If you allow null values in the child's foreign key column, I think you get that behavior. You can even set the Delete/Update rules to "Set to null" so it sets the foreign key's value to null when you delete the associated parent value.

Anyway, that is my understanding. I haven't actually used nullable foreign key columns...
 
Back
Top