[GO] SQL Server view trigger disabled/enabled situation

Source: Internet
Author: User

This article transferred from: http://blog.csdn.net/miqi770/article/details/48708199

SELECTT.name asTableName, Tr.name asTriggername, Case           when 1=ObjectProperty(Tr.id,'execistriggerdisabled')           Then 'Disabled'          ELSE 'Enabled'      ENDStatus fromsysobjects TINNER JOINsysobjects TR ont.id=Tr.parent_objWHERE(T.xtype= 'U'      ORT.xtype= 'V')   and(Tr.xtype= 'TR')  ORDER  byT.name, Tr.name

ALTER TABLE TABLENAME enable trigger triggername ALTER TABLE TableName enable trigger triggername View all triggers in the current library

This article transferred from: http://www.cnblogs.com/davidhou/p/5846914.html

--View all the triggers in the current library:
SELECT * from Sysobjects WHERE xtype = ' TR '

--View all the triggers in the current library and the tables that correspond to them:
SELECT Tb2.name as tablename,tb1.name as Triggername from Sysobjects Tb1 joins Sysobjects TB2 on Tb1.parent_obj=tb2.id wher E tb1.type= ' TR '

--Displays the definition of the trigger:
EXEC sp_helptext ' trigger name '

--View information about the trigger:
EXEC sp_help ' trigger name '

--View the types of triggers in the table:
EXEC sp_helptrigger ' table name '

[GO] SQL Server view trigger disabled/enabled situation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.