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

前端 未结 7 1130
太阳男子
太阳男子 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 05:03

    ALTER TABLE table_name DISABLE TRIGGER TRIGGER_NAME
    -- Here your SQL query
    ALTER TABLE table_name ENABLE TRIGGER TRIGGER_NAME
    

提交回复
热议问题