<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Disable All the Trigger of Current Database</title>
	<atom:link href="http://blog.sqlauthority.com/2008/08/19/sql-server-disable-all-the-trigger-of-current-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2008/08/19/sql-server-disable-all-the-trigger-of-current-database/</link>
	<description>SQL, SQL Server, MySQL, Big Data and NoSQL</description>
	<lastBuildDate>Thu, 20 Jun 2013 06:45:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jerry Crick</title>
		<link>http://blog.sqlauthority.com/2008/08/19/sql-server-disable-all-the-trigger-of-current-database/#comment-363828</link>
		<dc:creator><![CDATA[Jerry Crick]]></dc:creator>
		<pubDate>Wed, 24 Oct 2012 18:13:08 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=854#comment-363828</guid>
		<description><![CDATA[Hi - I searched the blog and other sources but could not find a way to do this: 
Disable all the triggers on a specific table when a specific user is doing a specific maintenance task within the context of a .NET application.

Any ideas gratefully received...

Thanks

Jerry]]></description>
		<content:encoded><![CDATA[<p>Hi &#8211; I searched the blog and other sources but could not find a way to do this:<br />
Disable all the triggers on a specific table when a specific user is doing a specific maintenance task within the context of a .NET application.</p>
<p>Any ideas gratefully received&#8230;</p>
<p>Thanks</p>
<p>Jerry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Babak</title>
		<link>http://blog.sqlauthority.com/2008/08/19/sql-server-disable-all-the-trigger-of-current-database/#comment-266785</link>
		<dc:creator><![CDATA[Babak]]></dc:creator>
		<pubDate>Fri, 23 Mar 2012 18:09:21 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=854#comment-266785</guid>
		<description><![CDATA[-- Include the schema:

DECLARE @string VARCHAR(8000)
DECLARE @tableName NVARCHAR(500)
DECLARE @Name NVARCHAR(500)
DECLARE cur CURSOR
FOR SELECT sys.objects.name as tbname, sys.schemas.name FROM sys.objects INNER JOIN sys.schemas ON sys.objects.schema_id = sys.schemas.schema_id 
				WHERE sys.objects.object_id IN(SELECT parent_obj FROM sysobjects WHERE xtype=&#039;tr&#039;)
OPEN cur
FETCH next FROM cur INTO @tableName, @Name
WHILE @@fetch_status = 0
BEGIN
SET @string =&#039;Alter table &#039;+ @Name +&#039;.&#039; +@tableName + &#039; Disable trigger all&#039;
EXEC (@string)
FETCH next FROM cur INTO @tableName, @Name
END
CLOSE cur
DEALLOCATE cur
GO]]></description>
		<content:encoded><![CDATA[<p>&#8211; Include the schema:</p>
<p>DECLARE @string VARCHAR(8000)<br />
DECLARE @tableName NVARCHAR(500)<br />
DECLARE @Name NVARCHAR(500)<br />
DECLARE cur CURSOR<br />
FOR SELECT sys.objects.name as tbname, sys.schemas.name FROM sys.objects INNER JOIN sys.schemas ON sys.objects.schema_id = sys.schemas.schema_id<br />
				WHERE sys.objects.object_id IN(SELECT parent_obj FROM sysobjects WHERE xtype=&#8217;tr&#8217;)<br />
OPEN cur<br />
FETCH next FROM cur INTO @tableName, @Name<br />
WHILE @@fetch_status = 0<br />
BEGIN<br />
SET @string =&#8217;Alter table &#8216;+ @Name +&#8217;.&#8217; +@tableName + &#8216; Disable trigger all&#8217;<br />
EXEC (@string)<br />
FETCH next FROM cur INTO @tableName, @Name<br />
END<br />
CLOSE cur<br />
DEALLOCATE cur<br />
GO</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: maga</title>
		<link>http://blog.sqlauthority.com/2008/08/19/sql-server-disable-all-the-trigger-of-current-database/#comment-263228</link>
		<dc:creator><![CDATA[maga]]></dc:creator>
		<pubDate>Thu, 15 Mar 2012 11:22:24 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=854#comment-263228</guid>
		<description><![CDATA[Ok, so i have disabled the triggers, how does enable it back using the above script?]]></description>
		<content:encoded><![CDATA[<p>Ok, so i have disabled the triggers, how does enable it back using the above script?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/08/19/sql-server-disable-all-the-trigger-of-current-database/#comment-108152</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Mon, 27 Dec 2010 10:41:32 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=854#comment-108152</guid>
		<description><![CDATA[Try using DDL trigger]]></description>
		<content:encoded><![CDATA[<p>Try using DDL trigger</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: prakasha</title>
		<link>http://blog.sqlauthority.com/2008/08/19/sql-server-disable-all-the-trigger-of-current-database/#comment-108136</link>
		<dc:creator><![CDATA[prakasha]]></dc:creator>
		<pubDate>Mon, 27 Dec 2010 09:56:33 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=854#comment-108136</guid>
		<description><![CDATA[How do we get the altered table name, time of altered, using trigger.]]></description>
		<content:encoded><![CDATA[<p>How do we get the altered table name, time of altered, using trigger.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CSP</title>
		<link>http://blog.sqlauthority.com/2008/08/19/sql-server-disable-all-the-trigger-of-current-database/#comment-64050</link>
		<dc:creator><![CDATA[CSP]]></dc:creator>
		<pubDate>Tue, 30 Mar 2010 14:31:40 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=854#comment-64050</guid>
		<description><![CDATA[sp_msforeachtable “ALTER TABLE ? DISABLE TRIGGER all”
sp_msforeachtable “ALTER TABLE ? ENABLE TRIGGER all”

This one is good, as written by rohit]]></description>
		<content:encoded><![CDATA[<p>sp_msforeachtable “ALTER TABLE ? DISABLE TRIGGER all”<br />
sp_msforeachtable “ALTER TABLE ? ENABLE TRIGGER all”</p>
<p>This one is good, as written by rohit</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/08/19/sql-server-disable-all-the-trigger-of-current-database/#comment-62071</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Wed, 03 Mar 2010 09:25:47 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=854#comment-62071</guid>
		<description><![CDATA[You can use
However note that they are all undocumented and may be removed from future release of SQL Server]]></description>
		<content:encoded><![CDATA[<p>You can use<br />
However note that they are all undocumented and may be removed from future release of SQL Server</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rohit</title>
		<link>http://blog.sqlauthority.com/2008/08/19/sql-server-disable-all-the-trigger-of-current-database/#comment-43181</link>
		<dc:creator><![CDATA[rohit]]></dc:creator>
		<pubDate>Tue, 23 Sep 2008 21:29:11 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=854#comment-43181</guid>
		<description><![CDATA[How about using this
sp_msforeachtable &quot;ALTER TABLE ? DISABLE TRIGGER  all&quot;
sp_msforeachtable &quot;ALTER TABLE ? ENABLE TRIGGER  all&quot;]]></description>
		<content:encoded><![CDATA[<p>How about using this<br />
sp_msforeachtable &#8220;ALTER TABLE ? DISABLE TRIGGER  all&#8221;<br />
sp_msforeachtable &#8220;ALTER TABLE ? ENABLE TRIGGER  all&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rama Krishna.K.S.</title>
		<link>http://blog.sqlauthority.com/2008/08/19/sql-server-disable-all-the-trigger-of-current-database/#comment-42849</link>
		<dc:creator><![CDATA[Rama Krishna.K.S.]]></dc:creator>
		<pubDate>Tue, 16 Sep 2008 10:08:54 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=854#comment-42849</guid>
		<description><![CDATA[I think the above(DISABLE ALL TRIGGERS ON THE TABLE) can also be deone with ALTER TABLE statement also.]]></description>
		<content:encoded><![CDATA[<p>I think the above(DISABLE ALL TRIGGERS ON THE TABLE) can also be deone with ALTER TABLE statement also.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Worth</title>
		<link>http://blog.sqlauthority.com/2008/08/19/sql-server-disable-all-the-trigger-of-current-database/#comment-41785</link>
		<dc:creator><![CDATA[Simon Worth]]></dc:creator>
		<pubDate>Tue, 19 Aug 2008 13:37:25 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=854#comment-41785</guid>
		<description><![CDATA[In the cursor, you may want to use the system view &quot;sys.Triggers&quot; to get a list of triggers in the context of the current database rather than the outdated SQL 2000 style of using sysobjects.  sysobjects is only for backward compatibility with 2000 and should be avoided on any new development.  At the very least - if you did not want to use sys.triggers then you should be using sys.objects on SQL 2005 and 2008.  
If development is on a 2000 instance then sysobjects is the way to go in order to get a list of triggers.

For 2005 and 2008 you could use
SELECT QUOTENAME(OBJECT_NAME(parent_id)) AS tbName from sys.triggers

But this does not take into account tables that exist within other schemas other than dbo.  You will just receive an error if you run that code on triggers within other schemas.]]></description>
		<content:encoded><![CDATA[<p>In the cursor, you may want to use the system view &#8220;sys.Triggers&#8221; to get a list of triggers in the context of the current database rather than the outdated SQL 2000 style of using sysobjects.  sysobjects is only for backward compatibility with 2000 and should be avoided on any new development.  At the very least &#8211; if you did not want to use sys.triggers then you should be using sys.objects on SQL 2005 and 2008.<br />
If development is on a 2000 instance then sysobjects is the way to go in order to get a list of triggers.</p>
<p>For 2005 and 2008 you could use<br />
SELECT QUOTENAME(OBJECT_NAME(parent_id)) AS tbName from sys.triggers</p>
<p>But this does not take into account tables that exist within other schemas other than dbo.  You will just receive an error if you run that code on triggers within other schemas.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
