How to get list of All Disabled/Enabled Triggers in SQL Server Database

The below query can be used to get the list of all enabled/disabled Triggers in SQL Server Database.
You can use the is_disabled column in sys.triggers table to filter the records according to your requirement.

SELECT                   AS TableName,
Schema_name(TBL.schema_id) AS Table_SchemaName,                   AS TriggerName,
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 
AND trg.is_disabled=1 --use this filter to get Disabled/Enabled Triggers

1 comment:

  1. No matter what your business is, you can always find a convenient solution that will optimize your workflow. I recommend checking out the website of this development company and learning more about web development technology such as Drupal. In addition, the speed of development is of great importance, which in this case is very high.