2012年2月24日星期五

Disable/Enable Triggers

I have stored procedure that disable triggers from another table then
completes the
body for the stored procedures then enables the triggers.
Is there an easy way to complete this task of disable and enable triggers
with very little overhead.
Thank You,
On Thu, 3 Nov 2005 14:30:03 -0800, Joe K. <Joe
K.@.discussions.microsoft.com> wrote:

>I have stored procedure that disable triggers from another table then
>completes the
>body for the stored procedures then enables the triggers.
>Is there an easy way to complete this task of disable and enable triggers
>with very little overhead.
>Thank You,
Hi Joe,
The good news: look up
ALTER TABLE table
{ ENABLE | DISABLE } TRIGGER { ALL | trigger_name [,..n] }
in Books Online.
The bad news: this is not a per-connection setting. If you disable the
trigger, it won't fire for ANY connection that's accessing the table.
Unless you can be sure that the stored proc is the only active process
at the time, I'd urge you to find another way to achieve what you want.
If you post more information about what business problem you're trying
to solve, we can help you find a better way.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)

没有评论:

发表评论