0

i need to email upon a job status being updated to delivered in an SQL server ie job gets delivered i want to email the customer with the details to say Delivery completed - I assume using an SQL trigger is a way to go - Does anyone have any tips on the best way to tackle such a scenario?

Want to avoid using expensive tools if possible eg APEX Sql trigger etc

PaulyboyUK
  • 29
  • 1
  • 8
  • 1
    This is likely to get closed as being primarily opinion based. The basic gist is you want to create a trigger that will populate a staging table, then have a sql job pull data from the staging table and send the email. DO NOT make your trigger wait for sending emails. – Sean Lange Feb 15 '16 at 13:58
  • 1
    You probably *don't* want to use a trigger for sending email (because sending email is quite complicated and prone to error). Instead, either wrap the `update`/`insert` in a stored procedure or schedule a job to send the emails at periodic intervals. – Gordon Linoff Feb 15 '16 at 13:59
  • I think this can be useful for you https://programmingistheway.wordpress.com/2015/04/17/sql-service-query-notifications-and-their-management-from-a-c-application/ – Piero Alberto Feb 15 '16 at 14:07
  • see this link for some different approaches... http://stackoverflow.com/questions/10755469/send-e-mail-from-a-trigger – TheGameiswar Feb 15 '16 at 14:50

0 Answers0