Microsoft SQL Server Types and classifications of Trigger


Example

In SQL Server, there are two categories of triggers: DDL Triggers and DML Triggers.

DDL Triggers are fired in response to Data Definition Language (DDL) events. These events primarily correspond to Transact-SQL statements that start with the keywords CREATE, ALTER and DROP.

DML Triggers are fired in response to Data Manipulation Language (DML) events. These events corresponds to Transact-SQL statements that start with the keywords INSERT, UPDATE and DELETE.

DML triggers are classified into two main types:

  1. After Triggers (for triggers)

    • AFTER INSERT Trigger.
    • AFTER UPDATE Trigger.
    • AFTER DELETE Trigger.
  2. Instead of triggers

    • INSTEAD OF INSERT Trigger.
    • INSTEAD OF UPDATE Trigger.
    • INSTEAD OF DELETE Trigger.