Quantcast
Viewing all articles
Browse latest Browse all 38722

Forum Post: RE: Business Alert for Item Cost Change

Yes.. you should be able to. First you might want to track those changes through DB trigger into a table. And then use SQL query to send the details in an email using the SP sp_send_dbmail and schedule the job for every 5 mins or whatever. You can send email in HTML format as well, but just need to add some more code to the below. These is a Business Alert within GP, but again it eventually going to create a SQL Agent Job. Also, you cannot use custom table created in SQL on GP Business Alert window, unless you create it in Dexterity. So better to do it directly in SQL. declare @body1 varchar(4000) set @body1 = 'Sample Email from SQL2008 ' + CONVERT( VARCHAR( 20 ), GETDATE(), 113 ) + ' ' EXEC msdb.dbo.sp_send_dbmail @profile_name='gMail', @recipients='lowell@yourdomain.com; "SQL Oracle" ; thirdemail@domain.com', @subject = 'SQl 2008 email test', @body = @body1, @body_format = 'HTML', @query = 'SELECT top 3 * from sysobjects where xtype=''U''', @query_result_header = 0, @exclude_query_output = 1, @append_query_error = 1, @attach_query_result_as_file = 1, @query_attachment_filename = 'qry.txt', @query_result_no_padding = 1 www.sqlservercentral.com/.../Topic976970-391-1.aspx

Viewing all articles
Browse latest Browse all 38722

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>