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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining if TRIGGER is active 2

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I am using SQL server 7.0 and have some TRIGGERS set up against tables for INSERT, UPDATE and DELETE actions. I am able to turn these on and off. What syntax should I be using to determine if a TRIGGER is currently active or not ?
Thanks in advance
Steve
 
It appears that the status on sysobjects table is updated when a trigger is abled or disabled. The disabled value is 2048 more than the enabled value.

Perhaps you could do a query like this.

select status, name from sysobjects
where type ='tr'
and name='triggername'

If status > 2048 then the trigger is disabled otherwise it is enabled. I think this will work with all triggers but cannot find any documentation to prove it. Terry
 
tlbroadbent - Thanks - I'll give that a whirl when I get to the office tomorrow.
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top