Find list of available Triggers in the database

Posted: February 24, 2010 in 1

Query to find the list of Triggers in the database categorized with Trigger Type

SELECT S2.[name] TableName, S1.[name] TriggerName,
CASE
WHEN S1.deltrig > 0 THEN ‘Delete’
WHEN S1.instrig > 0 THEN ‘Insert’
WHEN S1.updtrig > 0 THEN ‘Update’
END ‘TriggerType’
FROM sysobjects S1 JOIN sysobjects S2
ON S1.parent_obj = S2.[id]
WHERE S1.xtype=’TR’

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s