Tuesday, August 30, 2011

List ALL triggers within a Database

In SQL Server 2005 and above, we can make use of SYS.TRIGGERS to list all the Triggers within a database. The below query would help us list the trigger name and the table name on which this trigger is written.

SELECT
[name] AS Trigger_Name,
OBJECT_NAME(Parent_ID)
FROM
SYS.TRIGGERS
ORDER BY
Trigger_Name

No comments: