SQL Server: check whether a Trigger is Enabled or

2020-02-02 11:47发布

How we can see which Trigger is Enabled or Disabled in SQL Server 2008?

3条回答
霸刀☆藐视天下
2楼-- · 2020-02-02 12:07

Using sys.triggers

SELECT name, is_disabled FROM sys.triggers
查看更多
虎瘦雄心在
3楼-- · 2020-02-02 12:17

In big databases you usually don't know the table for the trigger.

SELECT OBJECT_NAME(parent_id) [table_name],[name] [trigger_name],is_disabled
FROM sys.triggers 
查看更多
乱世女痞
4楼-- · 2020-02-02 12:24

Descriptive State of Trigger help you to clearly ready about status. Also excluding triggers not related with user tables.

Check the below code:

SELECT OBJECT_NAME(parent_id) [Table_Name],[name] [Trigger_Name],
Case When is_disabled=0 then 'Enabled' Else 'Disabled' End [Trigger_Status], is_disabled
FROM sys.triggers 
where OBJECT_NAME(parent_id) is not null 
查看更多
登录 后发表回答