I have a INSERT, UPDATE trigger on a table, it works great and helps me from firing a stored procedure from all the (think it's over 50places) where it is needed.
But I have one batch update to this table, that doesn’t require the trigger procedure; the trigger is very heavy so I would like to make an exception only in this update. Is it possible to write something into the UPDATE statement or do I have to disable and enable the trigger every time this update runs?
Just to be clear, I’m thinking about something like this (except that I want to skip trigger instead of setting the update to only lock current row):
UPDATE <TABLENAME> WITH (ROWLOCK) SET <Column>='VALUE' WHERE ID=1
I have tried to put anything that comes into my mind after WITH, but still no luck.
Google haven't been at much help eiter.
It's kind of same solution I’m implementing now.
I have added a column called "TUpdate" it's a bit column that i set to true in all the different update statements. This solution will not use much load on the server, because the first thing i do in the trigger is to check if the value in INSERTED is True, if it is then it continues to do the work in the trigger, and it updates this column to be false in the end. It will take some space in the database, because i have around 11,5 million rows, but it doesn’t mater that much.
But this is not the optimal solution, I have been looking for this many times. Many people or talking about using individual rights, where they check what user that fires the trigger, and i can see why it works for many people. But it's a loot of work to implement, and like i mentioned, I would like to use this many places.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.