SQL Server 2005:暂时禁用触发器的 T-SQL [英] SQL Server 2005: T-SQL to temporarily disable a trigger

查看:36
本文介绍了SQL Server 2005:暂时禁用触发器的 T-SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以禁用批处理命令的触发器,然后在批处理完成后启用它?

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 wondering if there was another way.

推荐答案

DISABLE TRIGGER { [ schema_name . ] trigger_name [ ,...n ] | ALL }
ON { object_name | DATABASE | ALL SERVER } [ ; ]

http://msdn.microsoft.com/en-us/library/ms189748(SQL.90).aspx

后跟:

ENABLE TRIGGER { [ schema_name . ] trigger_name [ ,...n ] | ALL }
ON { object_name | DATABASE | ALL SERVER } [ ; ]

http://msdn.microsoft.com/en-us/library/ms182706(SQL.90).aspx

这篇关于SQL Server 2005:暂时禁用触发器的 T-SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆