Home Forums SQL Server 2012 SQL Server 2012 - T-SQL Challenge with trigger to send email, including attached file. @query needs variables... RE: Challenge with trigger to send email, including attached file. @query needs variables...

  • Michael,

    Thank you for the extra information. I have a lot of avenues to consider now, and I just need to wrap my head around some of the concepts and figure out which one I can best implement. I like the idea of service broker, I just do not have a clear enough understanding of it.

    I did comment on injecting the data into a table - mostly for followup action later. Our main inventory management application alerts us of events we should be concerned with, but I trend the events (which are manually acted upon). We currently insert that data into a table that the main app does not touch (in the same database, to simplify reporting). We have an in house built application that access that table, and allows our staff to record their actions against each entry. We can then determine what course of action was taken.

    IE, Received an alert that inventory was getting low, noticed that we did order inventory previously, but it has yet to be received. Manual investigation determines that it was shipped to site, and we had to remind the customer to receive it. We record this action based on a few true/false actions - and then I can report on how many times we ship to site, and have to remind the customer, which is reviewed with performance metrics at regular meetings. (This is a really simplified summary - but just to give you the idea why storing the data is important.)

    What was a "how do I make this trigger work" has evolved into a complete revisit of the structure in place. I now just have to wrap my head around it and make sure I go down a path I am able to support, and that my team can work underneath.