Disable Triggers

Last time, I had some calculation problems in one of my tables, and I needed to make a simple batch Update on the table but the following error was loading…

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

After several trial and errors, I finally found the problem: it was that I had a trigger on the table and it didn’t let me batch Update. After googling i found that you can disable any trigger using the following code in you SQL Statement:

DISABLE TRIGGER triggername ON tablename

add batch update or batch insert command;

ENABLE TRIGGER triggername ON tablename

And now the batch Update worked flawlessly. Hope this works for you too.

(PS. It’s important to insert a semi-colon (;) after your update or insert command, as it would give an error and wouldn’t re-enable the Trigger.)

Categories

No Responses

Leave a Reply

Your email address will not be published. Required fields are marked *