<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>New Poll is up and a silly mistake...</title><link>http://blogs.msdn.com/duncanma/archive/2004/07/10/179605.aspx</link><description>One of the big reasons I redesigned the poll component , was so that I could track votes over time... I did this by adding a 'dateVoted' column to my vote table, and then using an &amp;#8220;On Insert&amp;#8221; trigger to set that column to the current date/time....</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: New Poll is up and a silly mistake...</title><link>http://blogs.msdn.com/duncanma/archive/2004/07/10/179605.aspx#179650</link><pubDate>Sat, 10 Jul 2004 23:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:179650</guid><dc:creator>David Hayden</dc:creator><description>Hey Duncan,&lt;br&gt;&lt;br&gt;I am curious as to why you are using a trigger as opposed to just setting the 'dateVoted' column in code? On a lot of my tables I often have a 'CreateDate' field with the date the row was added to the table and a 'ModifyDate' when the row was last updated.  I normally just populate these fields via code as opposed to a trigger, but I always wondered what I would gain if I used a trigger.  Assuming the application I created is the only way rows are added and modified, does a trigger help me in any way?&lt;br&gt;&lt;br&gt;BTW, why do you mention &amp;quot;Tea&amp;quot; in the name of your blog? :)  Are you a fan of tea, the drink?</description></item><item><title>re: New Poll is up and a silly mistake...</title><link>http://blogs.msdn.com/duncanma/archive/2004/07/10/179605.aspx#179745</link><pubDate>Sun, 11 Jul 2004 03:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:179745</guid><dc:creator>Duncan Mackenzie</dc:creator><description>David... I prefer to use triggers for the date created and date modified because, even if your code is supposed to be the only way to edit the data, people often end up using new tools and/or things like SQL Enterprise Manager...&lt;br&gt;&lt;br&gt;oh, and yeah... big fan of the tea :)</description></item><item><title>re: New Poll is up and a silly mistake...</title><link>http://blogs.msdn.com/duncanma/archive/2004/07/10/179605.aspx#179966</link><pubDate>Sun, 11 Jul 2004 11:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:179966</guid><dc:creator>Sonu Kapoor</dc:creator><description>Mistakes happens. After all we are just humans :-) &lt;br&gt;BTW: I love tea too especially indian tea.</description></item><item><title>re: New Poll is up and a silly mistake...</title><link>http://blogs.msdn.com/duncanma/archive/2004/07/10/179605.aspx#179991</link><pubDate>Sun, 11 Jul 2004 13:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:179991</guid><dc:creator>David Hayden</dc:creator><description>Thanks for the answer, Duncan!&lt;br&gt;&lt;br&gt;I will use triggers on my personal project to get a feel for the difference in functionality and maintenance. My customers are not technically savvy enough to modify the data outside of the web application, but I agree that ideally these &amp;quot;rules&amp;quot; should be in the database itself.&lt;br&gt;&lt;br&gt;I am a big fan of tea as well.  I drink green tea daily and am enjoying it so much I told my wife we have to start an online store by year's end :)</description></item><item><title>re: New Poll is up and a silly mistake...</title><link>http://blogs.msdn.com/duncanma/archive/2004/07/10/179605.aspx#180568</link><pubDate>Mon, 12 Jul 2004 12:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:180568</guid><dc:creator>Michael Falconer</dc:creator><description>Hi Duncan,&lt;br&gt;&lt;br&gt;How about just setting the default value for the dateVoted column to getDate()? As good as a trigger (albeit the value can be overwritten when accessnig the table directly), but will be included when you export/script the table...&lt;br&gt;&lt;br&gt;P.S. I'm an ex-tea drinker!!</description></item><item><title>re: New Poll is up and a silly mistake...</title><link>http://blogs.msdn.com/duncanma/archive/2004/07/10/179605.aspx#182029</link><pubDate>Tue, 13 Jul 2004 20:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:182029</guid><dc:creator>DeanG</dc:creator><description>Where is the Question for the latest poll displayed at?</description></item><item><title>re: New Poll is up and a silly mistake...</title><link>http://blogs.msdn.com/duncanma/archive/2004/07/10/179605.aspx#182031</link><pubDate>Tue, 13 Jul 2004 20:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:182031</guid><dc:creator>Duncan Mackenzie</dc:creator><description>On my site at &lt;a target="_new" href="http://www.duncanmackenzie.net"&gt;http://www.duncanmackenzie.net&lt;/a&gt;&lt;br&gt;</description></item><item><title>re: New Poll is up and a silly mistake...</title><link>http://blogs.msdn.com/duncanma/archive/2004/07/10/179605.aspx#182658</link><pubDate>Wed, 14 Jul 2004 01:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:182658</guid><dc:creator>Kent Sharkey</dc:creator><description>An example of D's tea fetish. &lt;br&gt;&lt;br&gt;I just went into his &amp;quot;supplier's&amp;quot; shop in Winnipeg, and after ordering 2# of his brew of choice, I was asked, &amp;quot;Is this for ... Mackenzie?&amp;quot;&lt;br&gt;&lt;br&gt;...Where everyone knows your name...</description></item><item><title>re: New Poll is up and a silly mistake...</title><link>http://blogs.msdn.com/duncanma/archive/2004/07/10/179605.aspx#183198</link><pubDate>Wed, 14 Jul 2004 17:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:183198</guid><dc:creator>Feroz</dc:creator><description>Hi Duncan:&lt;br&gt;&lt;br&gt;I agree with Michael Falconer. Is there any specific reason to choose trigger over default value? </description></item></channel></rss>