What is a Trigger?
Database Triggers
Triggers are automated stored routines invoked by the database engine when specific data modification events take place.
Trigger Classification
| Timing | Trigger Event | Typical Use Case |
|---|---|---|
| BEFORE | INSERT / UPDATE / DELETE | Validation, auto-populating timestamps |
| AFTER | INSERT / UPDATE / DELETE | Audit logs, data replication, notification |
| INSTEAD OF | INSERT / UPDATE / DELETE on Views | Enabling writes on complex multi-table views |