﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / Track Updates in Quantity Field / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 12:28:11 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Track Updates in Quantity Field</title><link>http://www.sqlservercentral.com/Forums/Topic1261938-391-1.aspx</link><description>Having a SQL trigger sending email when data is changed is not a good idea. However, you may still want to get email ASAP, faster than periodic job...You can follow the previous advise to create a trigger which audit the changes into another table. Then design a service which pools the table and sends emails...Beeing in SQL2008, instead of triggers you may be interesting to try in-built CDC  (change tracking)</description><pubDate>Wed, 07 Mar 2012 09:02:58 GMT</pubDate><dc:creator>Eugene Elutin</dc:creator></item><item><title>RE: Track Updates in Quantity Field</title><link>http://www.sqlservercentral.com/Forums/Topic1261938-391-1.aspx</link><description>I agree totally.  I would recommend adding an audit table, and keep track of changes there by using a trigger to insert the important information to the audit table (who, what, when).Then you can just do a select when you want to find the information.</description><pubDate>Wed, 07 Mar 2012 08:47:24 GMT</pubDate><dc:creator>vikingDBA</dc:creator></item><item><title>RE: Track Updates in Quantity Field</title><link>http://www.sqlservercentral.com/Forums/Topic1261938-391-1.aspx</link><description>Be careful with this. Lots of people start out with this requirement and once they 50 emails in an hour, they decide it was a bad idea.What you might want is to track the changes in another table, and then periodically send out an update to yourself. Or only send an update if there hasn't been another update sent in the last hour.</description><pubDate>Wed, 07 Mar 2012 08:19:02 GMT</pubDate><dc:creator>Steve Jones - SSC Editor</dc:creator></item><item><title>RE: Track Updates in Quantity Field</title><link>http://www.sqlservercentral.com/Forums/Topic1261938-391-1.aspx</link><description>Also, if you want that trigger to send you email, you will need to turn on Database Mail (DBMail) in order to use it.To get you started, here is a simple script to send a message, once DBMail is turned on and set up.--simple messageEXEC msdb.dbo.sp_send_dbmail    @profile_name = 'SQL Server Agent Mail Profile',                             -- this should be the actual profile name you give it when set up    @recipients = 'someaddres@somecompany.com',		-- use ; between them if more than one    @body = 'This is a test of the emergency broadcast system....',    @subject = 'This is only a test' ;</description><pubDate>Wed, 07 Mar 2012 07:27:20 GMT</pubDate><dc:creator>vikingDBA</dc:creator></item><item><title>RE: Track Updates in Quantity Field</title><link>http://www.sqlservercentral.com/Forums/Topic1261938-391-1.aspx</link><description>You may want to read about Triggers which do exactly what you wanted!Link : [b][url=http://msdn.microsoft.com/en-us/library/ms191524.aspx]DML Triggers[/url][/b]</description><pubDate>Mon, 05 Mar 2012 22:06:11 GMT</pubDate><dc:creator>ColdCoffee</dc:creator></item><item><title>Track Updates in Quantity Field</title><link>http://www.sqlservercentral.com/Forums/Topic1261938-391-1.aspx</link><description>Hi,Thanks for your time. I only have basic info about Sql Server database handling. What I need to do is:I have a table containing stock quantity. What I need to do is whenever quantity changes in Stock field, database send an email to me.Please advice.Thanks!Zeeshan</description><pubDate>Mon, 05 Mar 2012 21:33:59 GMT</pubDate><dc:creator>zeeshandar</dc:creator></item></channel></rss>