The CREATE TRIGGER statement creates a new trigger in a database. Triggers are a type of stored procedure that are automatically executed when data in a table is modified with an
INSERT,
UPDATE, or
DELETE.
This function is an extension to SQL grammar as documented in the Microsoft ODBC Programmer’s Reference and implements a subset of the SQL 3/PSM (Persistent Stored Modules) specification.
In a DELETE or
UPDATE trigger, “OLD” or a OLD
correlation-name must be prepended to a column name to reference a column in the row of data prior to the update or delete operation.
In an INSERT or
UPDATE trigger, “NEW” or a NEW
correlation-name must be prepended to a column name to reference a column in the row about to be inserted or updated.
Triggers are executed either before or after an UPDATE,
INSERT, or
DELETE statement is executed, depending on the type of trigger.
An INSERT on Tuition calls the trigger.