Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Enable Disable All Triggers in a Database Expand / Collapse
Author
Message
Posted Wednesday, January 30, 2008 3:20 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, February 06, 2014 4:15 AM
Points: 1,242, Visits: 1,546
Comments posted to this topic are about the item Enable Disable All Triggers in a Database



Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
www.GrowWithSql.com

Post #449718
Posted Thursday, March 20, 2008 6:57 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, February 25, 2014 9:38 AM
Points: 1, Visits: 149
Hi
I have this command that is more simple

EXECUTE sp_msforeachtable "ALTER TABLE ? disable trigger ALL"


Adrian
Post #472207
Posted Friday, March 21, 2008 7:56 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, March 05, 2009 10:58 AM
Points: 62, Visits: 38
I have updated the initial query so that it will indicate the enabled/disabled triggers in a SQL Server 2005 database.


SELECT T.[name] as TableName,
TR.[Name] as TriggerName,
CASE WHEN 1=OBJECTPROPERTY(TR.[object_id], 'ExecIsTriggerDisabled')
THEN 'Disabled'
ELSE 'Enabled'
END Status
FROM sys.objects T
INNER JOIN sys.triggers TR
ON T.[object_id] = TR.parent_id
WHERE (T.type = 'U' or T.type = 'V')
ORDER BY T.[name], TR.[name];
Post #472810
Posted Tuesday, January 18, 2011 9:46 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, January 18, 2011 9:45 AM
Points: 1, Visits: 0
Refer Here:

[url=http://jjeyakumar.blogspot.com/2011/01/useful-ms-sql-statement-for-triggers.html][/url]
Post #1049485
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse