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
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.