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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.