I'm looking for an answer that satisfies my need on both SQL Server and MySQL.
I have a small, custom audit table that I will be writing to through triggers on various tables. There are situations where I would like to bypass those triggers. I know that I can make a column on the tables and use it as a sort of flag for the trigger, but I'm hoping to find something that generates less clutter.
Is it possible to prevent a trigger from being called using a variable in my statement or some other query side thing?
EDIT: To clarify, I'm not expecting an actual trigger/query that works on both platforms. I'm looking for a solution that fits the desired goal of not having to use an extra column in each table.
Best Answer
I answered a question like this back on
Jan 20, 2012
: Disable trigger for just one tableIt was a workaround for MySQL I suggested. No negative feedback so far.