<?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/"
	
	>
<channel>
	<title>
	Comments on: Triggers – good or bad?	</title>
	<atom:link href="https://lobsterpot.com.au/blog/2018/09/11/triggers-good-or-bad/feed/" rel="self" type="application/rss+xml" />
	<link>https://lobsterpot.com.au/blog/2018/09/11/triggers-good-or-bad/</link>
	<description></description>
	<lastBuildDate>Wed, 19 Sep 2018 21:19:41 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2018/09/11/triggers-good-or-bad/#comment-3282</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Wed, 19 Sep 2018 21:19:41 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=3836#comment-3282</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://lobsterpot.com.au/blog/2018/09/11/triggers-good-or-bad/#comment-3281&quot;&gt;Dragan Babovic&lt;/a&gt;.

I agree that it’s easy to find triggers - it’s just that you need to think to look. People look for stored procedures, but rarely triggers. The overhead of dealing with the “pseudo” tables is no worse than TVPs when you want to deal with multiple rows in the one operation.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://lobsterpot.com.au/blog/2018/09/11/triggers-good-or-bad/#comment-3281">Dragan Babovic</a>.</p>
<p>I agree that it’s easy to find triggers &#8211; it’s just that you need to think to look. People look for stored procedures, but rarely triggers. The overhead of dealing with the “pseudo” tables is no worse than TVPs when you want to deal with multiple rows in the one operation.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dragan Babovic		</title>
		<link>https://lobsterpot.com.au/blog/2018/09/11/triggers-good-or-bad/#comment-3281</link>

		<dc:creator><![CDATA[Dragan Babovic]]></dc:creator>
		<pubDate>Wed, 19 Sep 2018 20:15:13 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=3836#comment-3281</guid>

					<description><![CDATA[There&#039;s an old saying &quot;If your database is too fast and you want to slow it down just create some triggers.&quot;
Triggers are not just like any other code. If a trigger is present on a table it triggers (pun intended) creation of pseudo tables inserted and deleted. They are created in the row version and reside in memory. (Much better then back in the days when they were created by scanning the transaction log). In any case if the data-set operations are used and they affect lots of data, those pseudo tables are large and their creation may  slow down data updates considerably. Even if the triggers are disabled, they still slow the transactions down albeit less then if they are enabled. If there are more than one trigger on a table the pseudo tables will be created more than once. If they are referred more than once in the code they will be generated again each time. 
I did not use them last four years so my observations might be outdated. 

They have their role, but if they can be avoided, it&#039;s better to be so. 
Visibility is not an issue just execute

select * from sys.triggers

sp_helptext  will show you the trigger code.]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s an old saying &#8220;If your database is too fast and you want to slow it down just create some triggers.&#8221;<br />
Triggers are not just like any other code. If a trigger is present on a table it triggers (pun intended) creation of pseudo tables inserted and deleted. They are created in the row version and reside in memory. (Much better then back in the days when they were created by scanning the transaction log). In any case if the data-set operations are used and they affect lots of data, those pseudo tables are large and their creation may  slow down data updates considerably. Even if the triggers are disabled, they still slow the transactions down albeit less then if they are enabled. If there are more than one trigger on a table the pseudo tables will be created more than once. If they are referred more than once in the code they will be generated again each time.<br />
I did not use them last four years so my observations might be outdated. </p>
<p>They have their role, but if they can be avoided, it&#8217;s better to be so.<br />
Visibility is not an issue just execute</p>
<p>select * from sys.triggers</p>
<p>sp_helptext  will show you the trigger code.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2018/09/11/triggers-good-or-bad/#comment-3280</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Tue, 18 Sep 2018 20:47:39 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=3836#comment-3280</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://lobsterpot.com.au/blog/2018/09/11/triggers-good-or-bad/#comment-3279&quot;&gt;Cole&lt;/a&gt;.

Good to hear it, Cole. Testing is so important - triggers are like stored procedures and should be tested like them, but with extra care because they have a different kind of interface. Keep up the good work. :) ]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://lobsterpot.com.au/blog/2018/09/11/triggers-good-or-bad/#comment-3279">Cole</a>.</p>
<p>Good to hear it, Cole. Testing is so important &#8211; triggers are like stored procedures and should be tested like them, but with extra care because they have a different kind of interface. Keep up the good work. 🙂 </p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Cole		</title>
		<link>https://lobsterpot.com.au/blog/2018/09/11/triggers-good-or-bad/#comment-3279</link>

		<dc:creator><![CDATA[Cole]]></dc:creator>
		<pubDate>Tue, 18 Sep 2018 17:43:26 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=3836#comment-3279</guid>

					<description><![CDATA[I like triggers. Like any tool, it&#039;s a tool. The good or bad happens when someone uses them. Back in my early database dev days, I learned the meniacal behavior of poorly written (and untested) triggers. I got wised up quickly and learned how useful they can be when written--and tested, properly.

Yeah, I was the guy who made the DBA want to strangle me. Now I&#039;m a DBA. Yes, I have apologized to him more than once. Kind of like how a child grows up, has kids, and then apologizes to their parents for all their former childish behaviors.]]></description>
			<content:encoded><![CDATA[<p>I like triggers. Like any tool, it&#8217;s a tool. The good or bad happens when someone uses them. Back in my early database dev days, I learned the meniacal behavior of poorly written (and untested) triggers. I got wised up quickly and learned how useful they can be when written&#8211;and tested, properly.</p>
<p>Yeah, I was the guy who made the DBA want to strangle me. Now I&#8217;m a DBA. Yes, I have apologized to him more than once. Kind of like how a child grows up, has kids, and then apologizes to their parents for all their former childish behaviors.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: The Costs And Benefits Of Triggers &#8211; Curated SQL		</title>
		<link>https://lobsterpot.com.au/blog/2018/09/11/triggers-good-or-bad/#comment-3278</link>

		<dc:creator><![CDATA[The Costs And Benefits Of Triggers &#8211; Curated SQL]]></dc:creator>
		<pubDate>Tue, 11 Sep 2018 12:05:50 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=3836#comment-3278</guid>

					<description><![CDATA[[&#8230;] Rob Farley hits on my biggest complaint about triggers: [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] Rob Farley hits on my biggest complaint about triggers: [&#8230;]</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
