Disabled Triggers

Last Post 12 Aug 2012 04:24 AM by richard forhire. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
Brent Hinrichsen
New Member
New Member

--
19 Jun 2012 06:14 AM
I have a two part question I have the code below and it does a grat job of pulling in the triggers and telling me if they are enabled or not. But I only need to see the disables ones and I need to e-mail that info the the developers on a nightly bases.


ALTER PROCEDURE [dbo].[triggerstatus]
AS
--TRIGGER STATUS


IF object_id('tempdb..#TRIGGER_STATUS') IS NOT NULL

DROP TABLE #TRIGGER_STATUS

select *, CASE WHEN OBJECTPROPERTY(id,'ExecIsTriggerDisabled') = 0 THEN 'NO' ELSE 'YES' END AS [TRIGGER_DISABLED]

INTO #TRIGGER_STATUS

from dbo.sysobjects

WHERE xtype = 'TR'

ORDER BY name

select * from #TRIGGER_STATUS


GO
richard forhire
New Member
New Member

--
12 Aug 2012 04:24 AM
select name disabled_trigger
from dbo.sysobjects
where objectproperty (id, 'ExecIsTriggerDisabled') = 1
and xtype = 'TR'
You are not authorized to post a reply.

Acceptable Use Policy