<?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 Triggers on a Database &#8211; Disable All Triggers on All Servers</title>
	<atom:link href="http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/</link>
	<description>Notes of a SQL Server MVP and Database Administrator</description>
	<lastBuildDate>Sat, 21 Nov 2009 05:54:09 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Pio Venantius</title>
		<link>http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-56815</link>
		<dc:creator>Pio Venantius</dc:creator>
		<pubDate>Tue, 20 Oct 2009 13:59:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-56815</guid>
		<description>Hi Manish,

This query

select name as tbname from sysobjects where id in(select parent_obj from sysobjects where xtype=’tr’)

that you have used to retrieve the list of tables in the database is not correct.

The query you have provided will include tables and views and  the Alter table statement will not work with a view.

I would use the following query to retrieve just the table names.

select table_name from information_schema.tables where table_type = &#039;base table&#039;

Thanks</description>
		<content:encoded><![CDATA[<p>Hi Manish,</p>
<p>This query</p>
<p>select name as tbname from sysobjects where id in(select parent_obj from sysobjects where xtype=’tr’)</p>
<p>that you have used to retrieve the list of tables in the database is not correct.</p>
<p>The query you have provided will include tables and views and  the Alter table statement will not work with a view.</p>
<p>I would use the following query to retrieve just the table names.</p>
<p>select table_name from information_schema.tables where table_type = &#8216;base table&#8217;</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: feras mazen taleb</title>
		<link>http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-53015</link>
		<dc:creator>feras mazen taleb</dc:creator>
		<pubDate>Mon, 15 Jun 2009 11:11:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-53015</guid>
		<description>thanks alot mr   Manish Kaushik

the Procedure DisableAllTriggers works well 

But Could you let me add small notice :)

we have to Add [ and ] to the table name I tried to 
exceute this procedure on my database and error occured 
because of my table name [References] this is a key word

set @string =’Alter table [‘+ @tableName + ‘] Disable trigger all’</description>
		<content:encoded><![CDATA[<p>thanks alot mr   Manish Kaushik</p>
<p>the Procedure DisableAllTriggers works well </p>
<p>But Could you let me add small notice :)</p>
<p>we have to Add [ and ] to the table name I tried to<br />
exceute this procedure on my database and error occured<br />
because of my table name [References] this is a key word</p>
<p>set @string =’Alter table [‘+ @tableName + ‘] Disable trigger all’</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: satish</title>
		<link>http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-46177</link>
		<dc:creator>satish</dc:creator>
		<pubDate>Sat, 31 Jan 2009 04:47:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-46177</guid>
		<description>Hi Pinal,

I am a beginner. In an interview I have been asked how to know whether a trigger is working ? or how to know whether the trigger will be fired at the correct time? 
can you please help me...

thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>I am a beginner. In an interview I have been asked how to know whether a trigger is working ? or how to know whether the trigger will be fired at the correct time?<br />
can you please help me&#8230;</p>
<p>thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vishal Kapoor</title>
		<link>http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-43369</link>
		<dc:creator>Vishal Kapoor</dc:creator>
		<pubDate>Mon, 29 Sep 2008 12:24:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-43369</guid>
		<description>Hi all,

To enable &amp; disable all the triggers and constraints we have a system defined Stored Proc

Print &#039;Disabling all Constraints&#039;
exec sp_MSforeachtable &#039;ALTER TABLE ? NOCHECK CONSTRAINT ALL&#039;

Print &#039;Disabling all Triggers&#039;
exec sp_MSforeachtable &#039;ALTER TABLE ? DISABLE TRIGGER ALL&#039;




Print &#039;Enabling all Constraints&#039;
exec sp_MSforeachtable &#039;ALTER TABLE ? CHECK CONSTRAINT ALL&#039;

Print &#039;Enabling all Triggers&#039;
exec sp_MSforeachtable &#039;ALTER TABLE ? ENABLE TRIGGER ALL&#039;


I hope this helps.

Thanks
Vishal Kapoor</description>
		<content:encoded><![CDATA[<p>Hi all,</p>
<p>To enable &amp; disable all the triggers and constraints we have a system defined Stored Proc</p>
<p>Print &#8216;Disabling all Constraints&#8217;<br />
exec sp_MSforeachtable &#8216;ALTER TABLE ? NOCHECK CONSTRAINT ALL&#8217;</p>
<p>Print &#8216;Disabling all Triggers&#8217;<br />
exec sp_MSforeachtable &#8216;ALTER TABLE ? DISABLE TRIGGER ALL&#8217;</p>
<p>Print &#8216;Enabling all Constraints&#8217;<br />
exec sp_MSforeachtable &#8216;ALTER TABLE ? CHECK CONSTRAINT ALL&#8217;</p>
<p>Print &#8216;Enabling all Triggers&#8217;<br />
exec sp_MSforeachtable &#8216;ALTER TABLE ? ENABLE TRIGGER ALL&#8217;</p>
<p>I hope this helps.</p>
<p>Thanks<br />
Vishal Kapoor</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: michel</title>
		<link>http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-42637</link>
		<dc:creator>michel</dc:creator>
		<pubDate>Wed, 10 Sep 2008 07:52:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-42637</guid>
		<description>Good Day! I&#039;m a beginner with regards to triggers. Currently, I&#039;ve already created a couple of triggers that are working just fine. But my problem is that one of our clients bought a new server. They want to transfer some databases in the new server and that would affect the triggers that are currently working. Is it possible for the trigger to work in different servers?  What will be the syntax for that?
Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Good Day! I&#8217;m a beginner with regards to triggers. Currently, I&#8217;ve already created a couple of triggers that are working just fine. But my problem is that one of our clients bought a new server. They want to transfer some databases in the new server and that would affect the triggers that are currently working. Is it possible for the trigger to work in different servers?  What will be the syntax for that?<br />
Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nomvula</title>
		<link>http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-41784</link>
		<dc:creator>Nomvula</dc:creator>
		<pubDate>Tue, 19 Aug 2008 13:05:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-41784</guid>
		<description>hi Mr Dave
i&#039;ve seen your articles and are great, i need to create a script which will calculate a value based on previous value i.e ID        Depreciation
51004        0
54796        0
58585        -19079.347
62466        -113.57
66291        -113.57
70143        -113.57
74025        -113.57
77933        -113.57
81849        -113.57
on my script i need to calculate a Accummulative Depreciation on another field and the rule is on the first entry the Depreciation will remain the same, the second entry should take the value from the prevous entry add it to the current entry i.e for ID 51004 and 54796 AccumDepr will be 0 cause there&#039;s no Depreciation value this id 58585 should equal to 19079.347 cause there&#039;s no previous depr, and on ID 62466 my AccumDepr should be (-19079.347) + (-113.57) = -19192.91 and the next ID should be -19192.91 + -113.57 = -19306.48 and so forth...</description>
		<content:encoded><![CDATA[<p>hi Mr Dave<br />
i&#8217;ve seen your articles and are great, i need to create a script which will calculate a value based on previous value i.e ID        Depreciation<br />
51004        0<br />
54796        0<br />
58585        -19079.347<br />
62466        -113.57<br />
66291        -113.57<br />
70143        -113.57<br />
74025        -113.57<br />
77933        -113.57<br />
81849        -113.57<br />
on my script i need to calculate a Accummulative Depreciation on another field and the rule is on the first entry the Depreciation will remain the same, the second entry should take the value from the prevous entry add it to the current entry i.e for ID 51004 and 54796 AccumDepr will be 0 cause there&#8217;s no Depreciation value this id 58585 should equal to 19079.347 cause there&#8217;s no previous depr, and on ID 62466 my AccumDepr should be (-19079.347) + (-113.57) = -19192.91 and the next ID should be -19192.91 + -113.57 = -19306.48 and so forth&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pranil</title>
		<link>http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-41780</link>
		<dc:creator>Pranil</dc:creator>
		<pubDate>Tue, 19 Aug 2008 10:01:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-41780</guid>
		<description>Thanks a lot... Manish Kaushik!</description>
		<content:encoded><![CDATA[<p>Thanks a lot&#8230; Manish Kaushik!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER - Disable All the Trigger of Current Database Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-41773</link>
		<dc:creator>SQL SERVER - Disable All the Trigger of Current Database Journey to SQL Authority with Pinal Dave</dc:creator>
		<pubDate>Tue, 19 Aug 2008 01:31:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-41773</guid>
		<description>[...] 19, 2008 by pinaldave    I have previously written article about SQL SERVER - Disable All Triggers on a Database - Disable All Triggers on All Servers. This is alternate method to achieve the same [...]</description>
		<content:encoded><![CDATA[<p>[...] 19, 2008 by pinaldave    I have previously written article about SQL SERVER &#8211; Disable All Triggers on a Database &#8211; Disable All Triggers on All Servers. This is alternate method to achieve the same [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manish Kaushik</title>
		<link>http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-41749</link>
		<dc:creator>Manish Kaushik</dc:creator>
		<pubDate>Mon, 18 Aug 2008 05:30:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-41749</guid>
		<description>To disable all the trigger of current database.

CREATE Procedure [dbo].[DisableAllTriggers]
 
AS
      Declare @string varchar(8000)
      Declare @tableName nvarchar(500)
      Declare cur cursor 
            for select name as tbname from sysobjects where id in(select parent_obj from sysobjects where xtype=&#039;tr&#039;)
      open cur
      fetch next from cur into @tableName
      while @@fetch_status = 0
	     begin
            	set @string =&#039;Alter table &#039;+ @tableName + &#039; Disable trigger all&#039;             
                exec (@string)
            	Fetch next from cur into @tableName
	     end
      close cur
      deallocate cur


--To execute the SP---

Exec [DisableAllTriggers]</description>
		<content:encoded><![CDATA[<p>To disable all the trigger of current database.</p>
<p>CREATE Procedure [dbo].[DisableAllTriggers]</p>
<p>AS<br />
      Declare @string varchar(8000)<br />
      Declare @tableName nvarchar(500)<br />
      Declare cur cursor<br />
            for select name as tbname from sysobjects where id in(select parent_obj from sysobjects where xtype=&#8217;tr&#8217;)<br />
      open cur<br />
      fetch next from cur into @tableName<br />
      while @@fetch_status = 0<br />
	     begin<br />
            	set @string =&#8217;Alter table &#8216;+ @tableName + &#8216; Disable trigger all&#8217;<br />
                exec (@string)<br />
            	Fetch next from cur into @tableName<br />
	     end<br />
      close cur<br />
      deallocate cur</p>
<p>&#8211;To execute the SP&#8212;</p>
<p>Exec [DisableAllTriggers]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sudhan</title>
		<link>http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-41492</link>
		<dc:creator>Sudhan</dc:creator>
		<pubDate>Fri, 08 Aug 2008 15:33:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-41492</guid>
		<description>Hi Pinal
We use SQL Server 2000. I created a trigger, trying to update a field after a record is inserted.</description>
		<content:encoded><![CDATA[<p>Hi Pinal<br />
We use SQL Server 2000. I created a trigger, trying to update a field after a record is inserted.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: YG</title>
		<link>http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-41314</link>
		<dc:creator>YG</dc:creator>
		<pubDate>Mon, 04 Aug 2008 18:22:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/10/29/sql-server-disable-all-triggers-on-a-database-disable-all-triggers-on-all-servers/#comment-41314</guid>
		<description>How would

 DISABLE TRIGGER Person.uAddress ON AdventureWorks; 

disable all triggers on a database?  Person.uAddress is right there</description>
		<content:encoded><![CDATA[<p>How would</p>
<p> DISABLE TRIGGER Person.uAddress ON AdventureWorks; </p>
<p>disable all triggers on a database?  Person.uAddress is right there</p>
]]></content:encoded>
	</item>
</channel>
</rss>
