﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Wayne Fillis / Article Discussions / Article Discussions by Author  / An Alternative XML Solution / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 18 Jun 2013 00:54:16 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: An Alternative XML Solution</title><link>http://www.sqlservercentral.com/Forums/Topic141557-192-1.aspx</link><description>&lt;P&gt;There are indeed many solutions to creating XML from SQL Server.  I have had good success for several years using stored procedures that return multiple recordsets with embedded instructions for converting them to XML.  The only non-SQL code required is a generic utility class that executes the stored procedures, then interprets and converts the results.  For example:&lt;/P&gt;&lt;P&gt;create procedure shpClientOrders( @clientID int ) asselect 'DATASET clients.client' AS _shapeInfoselect * from clients where &lt;A href="mailto:id=@clientID"&gt;id=@clientID&lt;/A&gt;select 'DATASET orders.order RELATE TO clients' as _shapeInfoselect * from orders where &lt;A href="mailto:clientID=@clientID"&gt;clientID=@clientID&lt;/A&gt;select 'DATASET orderItems.item RELATE orderID to orders.id GROUPRECORDS' as _shapeInfoselect * from orderItems where &lt;A href="mailto:clientID=@clientID"&gt;clientID=@clientID&lt;/A&gt;results in:&lt;/P&gt;&lt;P&gt;&amp;lt;client id='1234' name='Client Name'...&amp;gt;    &amp;lt;order id='92342' orderDate='2004-10-12'&amp;gt;        &amp;lt;items&amp;gt;            &amp;lt;item id='00093' description='Skippy 12oz.' quantity='3'/&amp;gt;            &amp;lt;item id='00093' description='Welch's 8oz.' quantity='2'/&amp;gt;        &amp;lt;/items&amp;gt;    &amp;lt;/order&amp;gt;&amp;lt;/client&amp;gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description><pubDate>Wed, 10 Nov 2004 07:23:00 GMT</pubDate><dc:creator>Hugh Lynch</dc:creator></item><item><title>An Alternative XML Solution</title><link>http://www.sqlservercentral.com/Forums/Topic141557-192-1.aspx</link><description>Comments posted to this topic are about the content posted at &lt;A HREF=http://www.sqlservercentral.com/columnists/WFillis/analternativexmlsolution.asp&gt;http://www.sqlservercentral.com/columnists/WFillis</description><pubDate>Wed, 13 Oct 2004 11:28:00 GMT</pubDate><dc:creator>Wayne-153714</dc:creator></item></channel></rss>