SQL Server 2005: T-SQL to temporarily disable a trigger

前端 未结 7 1155
太阳男子
太阳男子 2020-12-08 04:33

Is it possible to disable a trigger for a batch of commands and then enable it when the batch is done?

I\'m sure I could drop the trigger and re-add it but I was won

7条回答
  •  盖世英雄少女心
    2020-12-08 04:44

    Not the best answer for batch programming, but for others finding this question in search of a quick and easy way to temporarily disable a trigger, this can be accomplished in SQL Server Management Studio.

    1. expand the triggers folder on the table
    2. right-click the trigger
    3. disable

    Follow the same process to re-enable.

提交回复
热议问题