Create Triggers

A trigger is a database object. When you create a trigger, you specify the table and the data modification commands that should fire, or activate, the trigger. Then, you specify any actions the trigger is to take.

For example, this trigger prints a message every time anyone tries to insert, delete, or update data in the titles table:

create trigger t1 
on titles 
for insert, update, delete 
as 
print "Now modify the titleauthor table the same way." 
Note: Unless you specify the existence of multiple triggers, each new trigger for the same operation—insert, update or delete—on a table or column overwrites the previous one without warning, and old triggers are dropped automatically.