HOW TO FIND LISTING ALL TRIGGER ON A DATABASE WITH SQL SERVER

Hi, How to find listing all trigger associated with a table with SQL Server

HOW TO FIND LISTING ALL TRIGGER

SELECT 
     sysobjects.name AS TriggerName 
    ,USER_NAME(sysobjects.uid) AS TriggerOwner 
    ,s.name AS table_schema 
    ,OBJECT_NAME(parent_obj) AS TableName
    ,OBJECTPROPERTY( id, 'ExecIsUpdateTrigger') AS IsUpdate 
    ,OBJECTPROPERTY( id, 'ExecIsDeleteTrigger') AS IsDelete 
    ,OBJECTPROPERTY( id, 'ExecIsInsertTrigger') AS IsInsert 
    ,OBJECTPROPERTY( id, 'ExecIsAfterTrigger') AS  IsAfter 
    ,OBJECTPROPERTY( id, 'ExecIsInsteadOfTrigger')AS IsInsteadof 
    ,OBJECTPROPERTY(id, 'ExecIsTriggerDisabled') AS [Disabled] 
FROM sysobjects 
INNER JOIN sysusers ON sysobjects.uid = sysusers.uid 
INNER JOIN sys.tables t ON sysobjects.parent_obj = t.object_id 
INNER JOIN sys.schemas s ON t.schema_id = s.schema_id 
WHERE sysobjects.type = 'TR' 

Thank you!

Leave a Reply