<?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: Automatic Update MSSQL 7.0 Field With Trigger</title>
	<atom:link href="http://www.techxplore.net/2008/05/30/automatic-update-mssql-70-field-with-trigger/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techxplore.net/2008/05/30/automatic-update-mssql-70-field-with-trigger/</link>
	<description>exploring computer hardware, software, Internet blogging, technology and gadgets</description>
	<lastBuildDate>Sat, 02 Jul 2011 04:30:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: tony</title>
		<link>http://www.techxplore.net/2008/05/30/automatic-update-mssql-70-field-with-trigger/#comment-480</link>
		<dc:creator>tony</dc:creator>
		<pubDate>Thu, 30 Apr 2009 20:57:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.techxplore.net/2008/05/30/automatic-update-mssql-70-field-with-trigger/#comment-480</guid>
		<description>thanks for the tip. I&#039;ll try that (SELECT FROM Inserted) clause</description>
		<content:encoded><![CDATA[<p>thanks for the tip. I&#8217;ll try that (SELECT FROM Inserted) clause</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://www.techxplore.net/2008/05/30/automatic-update-mssql-70-field-with-trigger/#comment-479</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Thu, 30 Apr 2009 20:19:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.techxplore.net/2008/05/30/automatic-update-mssql-70-field-with-trigger/#comment-479</guid>
		<description>This trigger would update every record in the table each time you add or update a single record... better would be:

CREATE TRIGGER UpdateFullName ON StudentHistory
FOR INSERT, UPDATE
AS
Update StudentHistory
set FullName = {fn CONCAT({fn RTRIM(FirstName)},{fn CONCAT(&#039; &#039;,{fn RTRIM(LastName)})})},
LastNameFirstName = {fn CONCAT({fn CONCAT({fn RTRIM(LastName)},&#039;, &#039;)},{fn RTRIM(FirstName)})}
WHERE  IN 
  (SELECT  FROM Inserted)

This will only update the records that were changed.</description>
		<content:encoded><![CDATA[<p>This trigger would update every record in the table each time you add or update a single record&#8230; better would be:</p>
<p>CREATE TRIGGER UpdateFullName ON StudentHistory<br />
FOR INSERT, UPDATE<br />
AS<br />
Update StudentHistory<br />
set FullName = {fn CONCAT({fn RTRIM(FirstName)},{fn CONCAT(&#8216; &#8216;,{fn RTRIM(LastName)})})},<br />
LastNameFirstName = {fn CONCAT({fn CONCAT({fn RTRIM(LastName)},&#8217;, &#8216;)},{fn RTRIM(FirstName)})}<br />
WHERE  IN<br />
  (SELECT  FROM Inserted)</p>
<p>This will only update the records that were changed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

