Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Are Triggers Traditionally Recursive in Back Ends?
Message
From
25/03/2000 23:19:32
 
 
To
25/03/2000 09:44:52
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00350383
Message ID:
00350481
Views:
19
Randy,

>My question is whether this is the traditional approach of most back ends that support triggers? Do any of the major players like SQL Server, Oracle or DB2 offer any options? [For example, something like a NORECURSE clause in a specific trigger.]

No experience here yet, but a quick search in MSDN library for Trigger gives this in SQL Server, Create Trigger T-SQL:


Recursive Triggers
SQL Server also allows recursive invocation of triggers when the recursive triggers setting is enabled in sp_dboption.

Recursive triggers allow two types of recursion to occur:

Indirect recursion
Direct recursion
With indirect recursion, an application updates table T1, which fires trigger TR1, updating table T2. In this scenario, trigger T2 then fires and updates table T1.

With direct recursion, the application updates table T1, which fires trigger TR1, updating table T1. Because table T1 has been updated, trigger TR1 fires again, and so on.

This example uses both indirect and direct trigger recursion. Assume that two update triggers, TR1 and TR2, are defined on table T1. Trigger TR1 updates table T1 recursively. An UPDATE statement executes each TR1 and TR2 one time. In addition, the execution of TR1 triggers the execution of TR1 (recursively) and TR2. The inserted and deleted tables for a given trigger contain rows corresponding only to the UPDATE statement that invoked the trigger.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Reply
Map
View

Click here to load this message in the networking platform