Corresponding rows are deleted/updated in the referencing table when that row is updated in the parent table.
When rows in the PK (referenced) table are deleted/updated, the respective rows of the FK (referencing) table with a matching foreign key column will get deleted/updated as well.
Alter Table TableFK
Add Constraint FK_CascadeExample Foreign Key(ID)
References TablePK(ID) On Delete Cascade On Update Cascade;
No comments:
Post a Comment