Quote:
Originally Posted by krisdotca
If I set an ON UPDATE CASCADE relationship and the entity that the foreign key refers to is deleted, what happens?
|
nothing -- you need to set ON DELETE CASCADE instead
ON UPDATE CASCADE means if you change the value of a PK, the related FKs will also be changed
Quote:
Originally Posted by krisdotca
For example, if I have the following and an address is deleted, will the customer-->address_id for any rows that refer to that address automatically be set to NULL?
|
no, if you want them set to null then you have to use ON DELETE SET NULL