Saturday, February 25, 2012

Checking Triggers....

Is there a way to check if triggers have been enabled or disabled?
Already found it
select objectproperty (object_id('triggernamegoeshere'),
'ExecIsTriggerDisabled')
A result of 0 = enabled.
"nivek" <eckart_612@.hotmail.com> wrote in message
news:UemdnQD7XMXDlCLcRVn-sQ@.centurytel.net...
> Is there a way to check if triggers have been enabled or disabled?
>
|||SELECT OBJECTPROPERTY(OBJECT_ID('TriggerName'), 'ExecIsTriggerDisabled')
Will return 1 if the trigger is disabled, 0 if it's enabled, NULL if you
enter an invalid name.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
"nivek" <eckart_612@.hotmail.com> wrote in message
news:UemdnQD7XMXDlCLcRVn-sQ@.centurytel.net...
> Is there a way to check if triggers have been enabled or disabled?
>
|||SELECT name, CASE OBJECTPROPERTY(id, 'ExecIsTriggerDisabled') WHEN 1 THEN
'Disabled' ELSE 'Enabled' END AS status
FROM sysobjects
WHERE xtype = 'TR'
Jacco Schalkwijk
SQL Server MVP
"nivek" <eckart_612@.hotmail.com> wrote in message
news:UemdnQD7XMXDlCLcRVn-sQ@.centurytel.net...
> Is there a way to check if triggers have been enabled or disabled?
>

No comments:

Post a Comment