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 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 
              
AND trg.is_disabled=1 --use this filter to get Disabled/Enabled Triggers

3 comments:

  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 https://anyforsoft.com/technology/drupal/ 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.

    ReplyDelete
  2. Ensuring a smooth, error-free operation, whether it’s through system settings or code, demands attention to detail. Just as you manage your system settings effectively, it’s crucial to improve code quality for seamless performance. High-quality code reduces bugs and maintenance overhead, much like well-configured settings ensure efficient system operations.

    ReplyDelete
  3. When planning for scalable and efficient e-commerce solutions, it’s important to consider how resources are allocated. This concept also applies to manufacturing, where capacity planning is crucial. For those in manufacturing or e-commerce development, tools like this list of Top 10 Manufacturing Capacity Planning Tools can greatly enhance the ability to manage resources, avoid overproduction, and streamline operations. This approach can be highly beneficial for businesses looking to scale efficiently.

    ReplyDelete