Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
binucn
Starting Member
5 Posts |
Posted - 2011-04-05 : 05:16:50
|
| It seems my trigger are executing multiple times on a single update. What are the situations that a trigger can execute multiple time?Please helpThanks in AdvanceBinu |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-04-05 : 07:34:39
|
| The only cases I can think of are either via recursion or nesting.If nested triggers option (at server level) is turned on this can happen. By default it is turned on.If RECURSIVE_TRIGGERS is turned on (at database level), then again this can happen. By default it is turned off.According to http://msdn.microsoft.com/en-us/library/ms190739.aspx "Only direct recursion of AFTER triggers is prevented when the RECURSIVE_TRIGGERS database option is set to OFF. To disable indirect recursion of AFTER triggers, also set the nested triggers server option to 0." |
 |
|
|
binucn
Starting Member
5 Posts |
Posted - 2011-04-06 : 00:13:20
|
| Thank you very much for the reply.This multiple execution of trigger does not happen every time. In my server nested trigger is set on. The Recursive-Triggerrs is OFF. This issue was reported by a user. Then only we found the issue. I ran an update on the Trigger Table and watched the result. But it was working smoothly. ThanksBinu |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|