You can use the OBJECTPROPERTY function for this...
select objectproperty(object_id('your-trigger-name'),
'ExecIsTriggerDisabled')
-----Original Message-----
From: Paul Bradshaw
[mailto:mssqldba-ezmlmshield-x66360518.[Email address protected]
Sent: Sunday, 29 April 2007 6:30 AM
To: LazyDBA Discussion
Subject: SQL to determine if Trigger is Enabled/Disabled
Maybe a silly question... but is there an easy SQL query that will let
me know if a given trigger is enabled or disabled?
I'm trying to come up with a script that will produce a report of all
the triggers in a database, and I can't figure out how to report whether
the trigger is enabled or not. I might as well ask now, but I'll need
something similar for Foreign Keys...
Thanks for any help!
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
"This e-mail and any attachments to it (the "Communication") is, unless otherwise stated, confidential, may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Australia and New Zealand Banking Group Limited ABN 11 005 357 522, or any of its related entities including ANZ National Bank Limited (together "ANZ"). ANZ does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication."
MS Sql Server LazyDBA home page