List all triggers in SQL Server database

SELECT [so].[name]                                         AS [Name], 
       User_name([so].[uid])                               AS [Owner], 
       User_name([so2].[uid])                              AS [Schema], 
       Object_name([so].[parent_obj])                      AS [TableName], 
       Objectproperty([so].[id], ‘execisupdatetrigger’)    AS [IsUpdate], 
       Objectproperty([so].[id], ‘execisdeletetrigger’)    AS [IsDelete], 
       Objectproperty([so].[id], ‘execisinserttrigger’)    AS [IsInsert], 
       Objectproperty([so].[id], ‘execisaftertrigger’)     AS [IsAfter], 
       Objectproperty([so].[id], ‘execisinsteadoftrigger’) AS [IsInsteadOf], 
       Objectproperty([so].[id], ‘execistriggerdisabled’)  AS [Disabled] 
FROM   sysobjects AS [so] 
       INNER JOIN sysobjects AS so2 
               ON so.parent_obj = so2.id 
WHERE  [so].[type] = ‘tr’ 
ORDER  BY [so].[name]

Leave a Comment

Your email address will not be published. Required fields are marked *