Quantcast
Channel: Welcome To TechBrothersIT
Viewing all articles
Browse latest Browse all 1979

Get all Triggers with Table Names in SQL Server

$
0
0
Often we come across situation where we need to find out the list of Tables on which triggers are enable. The below query will provide you list of all tables with triggers created on them.


SELECT TBL.name                   AS TableName,
      
Schema_name(TBL.schema_id) AS Table_SchemaName,
      
TRG.name                   AS TriggerName,
      
TRG.parent_class_desc,
      
CASE
        
WHEN TRG.is_disabled = 0 THEN 'Enable'
        
ELSE 'Disable'
      
END                        AS TRG_Status 

FROM   sys.triggers TRG
      
INNER JOIN sys.tables TBL
              
ON TBL.OBJECT_ID = TRG.parent_id 





Get Table Names with Triggers in SQL Server Database

Viewing all articles
Browse latest Browse all 1979

Trending Articles