Sunday, February 19, 2012

enable a trigger

Hi!

I know that you can enable/disable a trigger through the alter
table command. Once a trigger is disabled, is there a way
to determine whether it is disabled or enabled? I see there is a
status column in sysobjects ...is that what I should be using?
thanks in advance for any help
KarenKaren (kjphipps_357@.hotmail.com) writes:
> I know that you can enable/disable a trigger through the alter
> table command. Once a trigger is disabled, is there a way
> to determine whether it is disabled or enabled? I see there is a
> status column in sysobjects ...is that what I should be using?
> thanks in advance for any help

No. You should use objectproperty(id, 'ExecTriggerIsDisabled')

Note: I typed property from memory. Look up objectproperty in Books
Online to verify that I got it right.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

No comments:

Post a Comment