Triggers and Referential Integrity

Triggers are commonly used to enforce referential integrity (integrity rules about relationships between the primary and foreign keys of tables or views), and to supply cascading deletes and updates.

A trigger fires only after the data modification statement has completed and the SAP ASE server has checked for any datatype, rule, or integrity constraint violations. The trigger and the statement that fires it are treated as a single transaction that can be rolled back from within the trigger. If a severe error is detected, the entire transaction is rolled back.

You can also enforce referential integrity using constraints defined with the create tablecreate table statement as an alternative to using create trigger. See create table and alter table for information about integrity constraints.