Automate the sending the query result

  • Hi

    I have a requirement where I need to send the query resukts to my co-ordinator.

    The query is to find out the latest Transaction Date in three processes at the end of the day.

    We have three different SQL select queries to find out this for three processes.

    Is there any way by which we can automate the sending of these query results to my co-ordinator.

    Any help is really grateful.

  • Use DB mail and build up a mail via T-SQL and schedule it to run via SQL Agent.

  • Anthony, can you explain more on it and how it can be done.

    Guys, any other ideas are also welcome

  • Configure DB Mail if not already done so

    Lookup sp_send_dbmail in BOL or Google

    Declare a parameter which takes in a string, then run your select statements, build up the string and assign it to the parameter

    Pass the parameter into the sp_send_dbmail command

    Hey presto.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply