Benefits of Triggers
In Chapter 7, "Enforcing Data Integrity," you learned how to enforce business rules by defining constraints. In some real case scenarios, you can find problems that cannot be solved by using constraints. However, using the programmatic capabilities of triggers, you can create complex rules with endless possibilities.
A trigger is a stored procedure that is called automatically whenever you execute the action to which the trigger is defined. You cannot call a trigger directly, but you can execute the action that fires the trigger.
A trigger does not accept parameters and cannot call the RETURN statement to return a value, but it can return results, as any other stored procedure, although it is not recommended. A ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access