Types of Triggers According to Their Order

SQL Server 2000 defines two different types of triggers:

  • INSTEAD OF triggers that fire instead of the original action, before the base object is modified

  • AFTER triggers that fire after the base table is modified

A table can have any number of AFTER triggers for every action, but only one INSTEAD OF trigger per action.

A view can have only INSTEAD OF triggers.

INSTEAD OFTriggers

INSTEAD OF triggers are fired automatically when you execute a statement by which the trigger is defined. In this case, the trigger fires before the action is executed. However, inside an INSTEAD OF trigger, you have access to the Inserted and Deleted virtual tables.

When the INSTEAD OF trigger starts its execution, ...

Get Microsoft® SQL Server™ 2000 Programming by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.