I have an auditing trigger that automatically places the time something was updated and the user that updated in fields in all my tables. I have another set of triggers that write event information from updates to an events table. The issue is when someone updates something, the event information is fired twice because of the first triggers. How to I suppress the duplicate entries?
How to fetch unmatching records from two SQL tables?
How to use the LIKE keyword in SQL?
A DB2 Trigger to calculate an average in another table
It returns the current level of trigger nesting.
LIKE in dynamic queries
You can check that to prevent the duplicates..
SQL: Optimization problem, has rows?
How do I use DB2 Explain?
Insert Into SQL Statement
sub query with parameter?
- Either combine both sets of triggers into one..
- Or, there is a per database setting that allows recursive firing of triggers to be disabled..
There is a stored procedure (Sql 2005) called sp_configure that lets you modify the server's configuration.
The statement below disables nested triggers, which will stop a trigger from firing another trigger.. exec sp_configure 'nested triggers', 0.
Then select "Advanced" from the list on the left and set the value for "Allow Triggers to Fire Others" to 'False'..