<?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 On Views? What For?</title>
	<atom:link href="http://michaeljswart.com/2012/10/triggers-on-views-what-for/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaeljswart.com/2012/10/triggers-on-views-what-for/</link>
	<description>Database Whisperer</description>
	<lastBuildDate>Thu, 23 May 2013 10:06:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Regina</title>
		<link>http://michaeljswart.com/2012/10/triggers-on-views-what-for/comment-page-1/#comment-8778</link>
		<dc:creator>Regina</dc:creator>
		<pubDate>Sat, 17 Nov 2012 00:05:03 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3163#comment-8778</guid>
		<description><![CDATA[FWIW:  PostgreSQL 9.1 introduced INSTEAD OF triggers on views and triggers on views are the recommended approach from 9.1+ over rules for updating views just because they are more predictable.]]></description>
		<content:encoded><![CDATA[<p>FWIW:  PostgreSQL 9.1 introduced INSTEAD OF triggers on views and triggers on views are the recommended approach from 9.1+ over rules for updating views just because they are more predictable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mbourgon</title>
		<link>http://michaeljswart.com/2012/10/triggers-on-views-what-for/comment-page-1/#comment-8706</link>
		<dc:creator>mbourgon</dc:creator>
		<pubDate>Fri, 02 Nov 2012 15:03:24 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3163#comment-8706</guid>
		<description><![CDATA[Yup - wanted to post it somewhere in hopes somebody could use it as an object lesson of why not to allow it to do direct inserts into tables.  

The reason it was done that way originally makes sense: they didn&#039;t want to have to write 50 stored procedures to access the data 
In retrospect, if I&#039;d known of the web page, we could have come up with a Stored Procedure that did this, albeit with either dynamic SQL or with the SP hitting a view that consolidated the tables.

There is a stackoverflow case on it, albeit with no responses.  http://stackoverflow.com/questions/13077537/how-to-make-sqldatasource-insert-into-view-instead-of-the-underlying-table

Triggers aren&#039;t always a bad thing.  But they can have significant gotchas.]]></description>
		<content:encoded><![CDATA[<p>Yup &#8211; wanted to post it somewhere in hopes somebody could use it as an object lesson of why not to allow it to do direct inserts into tables.  </p>
<p>The reason it was done that way originally makes sense: they didn&#8217;t want to have to write 50 stored procedures to access the data<br />
In retrospect, if I&#8217;d known of the web page, we could have come up with a Stored Procedure that did this, albeit with either dynamic SQL or with the SP hitting a view that consolidated the tables.</p>
<p>There is a stackoverflow case on it, albeit with no responses.  <a href="http://stackoverflow.com/questions/13077537/how-to-make-sqldatasource-insert-into-view-instead-of-the-underlying-table" rel="nofollow">http://stackoverflow.com/questions/13077537/how-to-make-sqldatasource-insert-into-view-instead-of-the-underlying-table</a></p>
<p>Triggers aren&#8217;t always a bad thing.  But they can have significant gotchas.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Something for the Weekend - SQL Server Links 02/11/12</title>
		<link>http://michaeljswart.com/2012/10/triggers-on-views-what-for/comment-page-1/#comment-8705</link>
		<dc:creator>Something for the Weekend - SQL Server Links 02/11/12</dc:creator>
		<pubDate>Fri, 02 Nov 2012 14:21:18 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3163#comment-8705</guid>
		<description><![CDATA[[...] Triggers On Views? What For? - Michael J. Swart (Blog&#124;Twitter) explains in this excellent walk-through. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Triggers On Views? What For? - Michael J. Swart (Blog|Twitter) explains in this excellent walk-through. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael J. Swart</title>
		<link>http://michaeljswart.com/2012/10/triggers-on-views-what-for/comment-page-1/#comment-8703</link>
		<dc:creator>Michael J. Swart</dc:creator>
		<pubDate>Fri, 02 Nov 2012 13:13:03 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3163#comment-8703</guid>
		<description><![CDATA[Hey there MBourgon, 

Digressing a bit here, but you&#039;ve hit on one of the reasons that triggers make me uneasy. Triggers are not bad for their own sake, but they&#039;re a symptom that something else is wrong. In your case as you&#039;ve found out, you&#039;re already very very aware of what&#039;s wrong. It&#039;s just that you don&#039;t have control to do anything about it. And that&#039;s always frustrating.]]></description>
		<content:encoded><![CDATA[<p>Hey there MBourgon, </p>
<p>Digressing a bit here, but you&#8217;ve hit on one of the reasons that triggers make me uneasy. Triggers are not bad for their own sake, but they&#8217;re a symptom that something else is wrong. In your case as you&#8217;ve found out, you&#8217;re already very very aware of what&#8217;s wrong. It&#8217;s just that you don&#8217;t have control to do anything about it. And that&#8217;s always frustrating.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mbourgon</title>
		<link>http://michaeljswart.com/2012/10/triggers-on-views-what-for/comment-page-1/#comment-8698</link>
		<dc:creator>Mbourgon</dc:creator>
		<pubDate>Fri, 02 Nov 2012 05:32:26 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3163#comment-8698</guid>
		<description><![CDATA[One catch that I&#039;ve been trying to work around this week - if this is for a  IIS/.Net web page using a SqlDataSource (or maybe it&#039;s called a sqlDataControl), the object will NOT use views properly. Behind the scenes, it executes sys.columns to get a field listing, then updates the UNDERLYING TABLE DIRECTLY.  Our dev had no idea it could even do that, can&#039;t turn it off,, so what should have been a simple table/view flip has turned into a nightmare as we replace views with tables that use AFTER triggers, and changing other SPs to keep everything in sync. It&#039;s a CF.

  TL;DR : __make__ your web devs use SPs. Don&#039;t let them insert into a table directly.]]></description>
		<content:encoded><![CDATA[<p>One catch that I&#8217;ve been trying to work around this week &#8211; if this is for a  IIS/.Net web page using a SqlDataSource (or maybe it&#8217;s called a sqlDataControl), the object will NOT use views properly. Behind the scenes, it executes sys.columns to get a field listing, then updates the UNDERLYING TABLE DIRECTLY.  Our dev had no idea it could even do that, can&#8217;t turn it off,, so what should have been a simple table/view flip has turned into a nightmare as we replace views with tables that use AFTER triggers, and changing other SPs to keep everything in sync. It&#8217;s a CF.</p>
<p>  TL;DR : __make__ your web devs use SPs. Don&#8217;t let them insert into a table directly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael J. Swart</title>
		<link>http://michaeljswart.com/2012/10/triggers-on-views-what-for/comment-page-1/#comment-8694</link>
		<dc:creator>Michael J. Swart</dc:creator>
		<pubDate>Thu, 01 Nov 2012 17:37:41 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3163#comment-8694</guid>
		<description><![CDATA[Thanks for the feedback JJEugene. It was a fun post to write.]]></description>
		<content:encoded><![CDATA[<p>Thanks for the feedback JJEugene. It was a fun post to write.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JJEugene</title>
		<link>http://michaeljswart.com/2012/10/triggers-on-views-what-for/comment-page-1/#comment-8692</link>
		<dc:creator>JJEugene</dc:creator>
		<pubDate>Thu, 01 Nov 2012 17:02:21 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3163#comment-8692</guid>
		<description><![CDATA[Awesome post.  Well explained, plus a use-case.  Thanks for taking the time to do this.]]></description>
		<content:encoded><![CDATA[<p>Awesome post.  Well explained, plus a use-case.  Thanks for taking the time to do this.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching using disk: basic
Object Caching 265/267 objects using disk: basic

 Served from: michaeljswart.com @ 2013-05-24 21:31:47 by W3 Total Cache -->