Combine multiple query results into a single XML file.

  • Does anyone know how to combine multiple query results into a single xml file?

  • Consider the following template:

    <?

    xml version="1.0" encoding="utf-8" ?>

    <

    Order xmlns:sql="urn:schemas-microsoft-com:xml-sql">

    <sql:header>

    <sql:param name="customerId"></sql:param>

    </sql:header>

    <CustomerInfo statusCode="active">

    <sql:query>

    SELECT * FROM customers

    WHERE customerId=@customerId

    FOR XML AUTO, elements

    </sql:query>

    </CustomerInfo>

    <Orders>

    <sql:query>

    SELECT * FROM Orders

    INNER JOIN [Order Details] OrderDetail

    ON Orders.OrderId = OrderDetail.OrderId

    WHERE customerId=@customerId

    FOR XML AUTO

    </sql:query>

    </Orders>

    </

    Order>

    When properly configured for the Northwind database, the url

    http://localhost/NorthWind/template/message.xml?customerId=ALFKI

    delivers a nicely nested xml result.

     

    EE de Bel

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

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