Previous Topic

Next Topic

Inhoudsopgave

Book Index

Recursive Behavior Of Triggers

In ASE, if a trigger modifies its own base table, triggers do not fire recursively. If a trigger calls a stored procedure and the stored procedure modifies the base table of the trigger, the trigger does fire recursively.

In MS SQL Server, you can choose if triggers have to fire recursively or not.

exec sp_configure 'nested triggers', [0 | 1]

If you choose to disallow nested trigger behavior, both direct and indirect recursion is disabled. So if you modify the base table of the trigger from the trigger itself, the trigger does not fire recursively. But also, if the trigger calls a stored procedure and the stored procedure modifies the base table of the trigger, the trigger does not fire recursively.

Furthermore, the maximum recursive level in ASE is 16, whereas in MS SQL Server, the maximum call stack depth is 32.