Designing Triggers

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Designing Triggers as PDF for free.

More details

  • Words: 222
  • Pages: 1
Designing Triggers Microsoft® SQL Server™ 2000 provides two options when designing triggers: •

INSTEAD OF triggers are executed in place of the usual triggering action. INSTEAD OF triggers can also be defined on views with one or more base tables, where they can extend the types of updates a view can support.



AFTER triggers are executed after the action of the INSERT, UPDATE, or DELETE statement is performed. Specifying AFTER is the same as specifying FOR, which is the only option available in earlier versions of SQL Server. AFTER triggers can be specified only on tables.

This table compares the functionality of the AFTER and INSTEAD OF triggers. Function

AFTER trigger

INSTEAD OF trigger

Applicability

Tables

Tables and views

Quantity per table or view

Multiple per triggering action (UPDATE, DELETE, and INSERT)

One per triggering action (UPDATE, DELETE, and INSERT)

Cascading references

No restrictions apply

Are not allowed on tables that are targets of cascaded referential integrity constraints.

Execution

After:

Before:



Constraint processing



Declarative referential actions





Order of execution

inserted and deleted tables creation The triggering action

First and last execution may be specified

text, ntext, and image Not allowed column references in inserted and deleted tables



Constraint processing

In place of: •

The triggering action

After: •

inserted and deleted tables creation

Not applicable Allowed

Related Documents

Designing Triggers
November 2019 46
Triggers
May 2020 15
Triggers
November 2019 38
Triggers
June 2020 12
Triggers
May 2020 17
14 Triggers
November 2019 30