Using Recursive Triggers
Recursive triggers were introduced in SQL Server 7.0. If a trigger modifies the same table where the trigger was created, the trigger does not fire again unless the recursive triggers
option is turned on. recursive triggers
is a database option turned off by default.
The first command in the following example checks the setting of recursive triggers
for the AdventureWorks2012
database, and the second sets recursive triggers
to TRUE
:
select DATABASEPROPERTYEX ('AdventureWorks2012', 'IsRecursiveTriggersEnabled')ALTER DATABASE AdventureWorks2012 SET RECURSIVE_TRIGGERS ON
If you turn off nested triggers, recursive triggers are automatically disabled, regardless of how the database option is ...
Get Microsoft® SQL Server 2012 Unleashed 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.