9. Ensuring Data Integrity : Rules : How Rules Are Used : Before and After Rules
 
Share this page                  
Before and After Rules
Rules can be defined to execute before or after the effect of the triggering statement is applied. AFTER rules are more common and are used to perform auditing operations, integrity checks, and other operations on the updated rows. BEFORE rules can be used to validate and replace values in an inserted or updated row before the row is stored in the database. Both types of rules can be used to inhibit the execution of the triggering statement if an error condition is encountered, although BEFORE rules can typically do so more efficiently.