Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking if a trigger is disabled

Status
Not open for further replies.

kgomotso

Programmer
Oct 31, 2000
20
ZA
How do I know if a trigger has been disabled (disabled using : alter table XXXXX disable trigger YYYYY). I have been relaxed thinking that my triggers were running OK until I lost the data from the original table and when I had a look at the audit table(created from the trigger) I find that although the trigger had been defined, it has not been running for MONTHS.
 
It's fine guys i found it.

Use of OBJECTPROPERTY function will accomplish this as follows: SELECT OBJECTPROPERTY(OBJECT_ID('tr_Test'),'ExecIsTriggerDisabled') You will receive a return value of 1 for a disabled trigger and 0 for and enabled trigger. This can be helpfull to check first instead of spending hours only to find a simple mistake of a diabled trigger.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top