How to disable and enable a trigger

Business rules in table triggers often expect your application to update the table one row at a time. Also, some triggers generate an error when the code in the trigger assigns to a local variable the value returned by selecting a column from the inserted virtual table. The assignment fails if you're updating multiple rows because the inserted table contains more than one row, so the subquery returns more than a single value.

Multirow updates need special handling in such a scenario. Developers often wind up dropping a trigger before multirow updates, then creating them later to resume single-row updates. However, I recommend disabling such a trigger instead:

ALTER TABLE MyTable DISABLE TRIGGER MyTrigger

You can re-enable the trigger once you finish your multirow data updates:

ALTER TABLE MyTable ENABLE TRIGGER MyTrigger

Is this useful?