Insert trigger example  Cascading delete example

Chapter 19: Triggers: Enforcing Referential Integrity

Delete trigger examples

When you delete a primary key row, delete corresponding foreign key rows in dependent tables. This preserves referential integrity by ensuring that detail rows are removed when their master row is deleted. If you do not delete the corresponding rows in the dependent tables, you may end up with a database with detail rows that cannot be retrieved or identified. To properly delete the dependent foreign key rows, use a trigger that performs a cascading delete.





Copyright © 2005. Sybase Inc. All rights reserved. Cascading delete example

View this book as PDF