New to XML....???

  • Hi,

    I',m new to XML and here is what I need to do...

    I want to create a SQL query to pull data and update a field on a table with current date and another field an "X"

    I need the data in the select to be written to an XML.

    I then need the XML file emailed,

    Once emailed I need to run another query to update the 'X" to 'Y' showing its been sent...

    I assume I can do this from some job steps?

    I really don't know where to start??

    Thanks

    Joe

  • jbalbo (4/30/2013)


    Hi,

    I',m new to XML and here is what I need to do...

    I want to create a SQL query to pull data and update a field on a table with current date and another field an "X"

    I need the data in the select to be written to an XML.

    I then need the XML file emailed,

    Once emailed I need to run another query to update the 'X" to 'Y' showing its been sent...

    I assume I can do this from some job steps?

    I really don't know where to start??

    Thanks

    Joe

    Sounds like you could use the sp_send_dbmail stored procedure with the @query parameter and the FOR XML clause to extract the data you want to send. Your UPDATE statements will have to be separate, but you can use transaction control and TRY-CATCH error handling to maintain the integrity and consistency of the data (e.g., rolling back the UPDATE statements if the sp_send_dbmail proc fails).

    Look into those concepts, and if you have questions about how to implement them, please post back.

    Jason Wolfkill

Viewing 2 posts - 1 through 1 (of 1 total)

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