Query to XML

  • (SS 2008 - SSIS)

    We have online account statements available to our customers. They are actually stored in XML, then when requested, they go through XSL transformation to HTML for display. This is a once/month process to generate and store them, and it is currently handled by a Java program with the data coming from SS.

    I would like to explore generating each XML account statement from a SQL query using SS XML functionality. Naturally, I have the queries for data I need, and the exact format required for the XML output, by example, from what we have now.

    I've looked at the FOR XML, RAW, TYPE etc, in books online, but quite honestly, I'm a bit confused as to how to approach this. Where should I be looking ? Do I need to study XSDs ? I simply want to specify, either in the query itself, or possibly a template of some kind, the exact XML output I need for the file. I'm not interested in the transformation to HTML part - what we have should be fine for now - I can make that 'phase 2' possibly.

    Suggestions ?

    JimInFL

  • This article[/url] is about using XML for string manipulations, but it does explain (and show) how these different XML parts work.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

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

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