Actions of Multiple Triggers
When an UPDATE or MERGE statement activates multiple triggers,
the trigger actions merge. Assume that taba has columns a, b, c,
and d, as this example shows:
CREATE TABLE taba (a INT, b INT, c INT, d INT);
Next, assume that you define trig1 on columns a and c,
and trig2 on columns b and d. If both triggers
specify BEFORE, FOR EACH ROW, and AFTER actions, then the trigger
actions are executed in the following order:
- BEFORE action list for trigger (a, c)
- BEFORE action list for trigger (b, d)
- FOR EACH ROW action list for trigger (a, c)
- FOR EACH ROW action list for trigger (b, d)
- AFTER action list for trigger (a, c)
- AFTER action list for trigger (b, d)
The database server treats all the triggers that are activated by the same triggering statement as a single trigger, and the trigger action is the merged-action list. All the rules that govern a trigger action apply to the merged list as one list, and no distinction is made between the two original triggers.