2012年2月19日星期日

DISABLE TRIGGER

How can i disable a trigger'
Any suggestion appreciated.
Message posted via http://www.webservertalk.comHi
-- to diable all
EXEC sp_MSForEachTable N'ALTER TABLE ? DISABLE TRIGGER ALL'
GO
-- to enable all
EXEC sp_MSForEachTable N'ALTER TABLE ? ENABLE TRIGGER ALL'
Note : sp_MSForEachTable is undocumented ans unsupported
"akej via webservertalk.com" <forum@.nospam.webservertalk.com> wrote in message
news:06352efd0e4e43029b575e79a35d51ca@.SQ
webservertalk.com...
> How can i disable a trigger'
> Any suggestion appreciated.
> --
> Message posted via http://www.webservertalk.com|||So maybe better to drop(disable) and afete create(enable)
Message posted via http://www.webservertalk.com|||No, no need to drop and recreate. Simply use
ALTER TABLE table_name DISABLE TRIGGER trigger_name
Replace names as appropriate. Also, to disable all triggers, as Uri already
suggested, replace trigger_name with ALL keyword.
To enable the trigger again, replace DISABLE with ENABLE.
Regards,
Raj|||What about to disable/enable constraint, foreign key constraint '
Message posted via http://www.webservertalk.com

没有评论:

发表评论