Just a quick note for anyone who hasn't gotten a chance to play with
MSSQL SQLXML yet, here is snippet showing how to get SQL Server to
return XML to CF.

The MS SOAP Toolkit and SQLXML both need to be installed on the server
before this will work.


<cfquery datasource="northwind" name="xml">
SELECT Customers.CustomerID, Orders.OrderID, Customers.ContactName
FROM Customers, Orders
WHERE Customers.CustomerID = Orders.CustomerID
FOR XML AUTO
</cfquery>

<cfset column = xml.columnList>

<cfset xmlStr = ''>
<cfloop from="1" to="#xml.recordCount#" index="i">
        <cfset xmlStr = xmlStr & xml[column][i]>
</cfloop>

<root>
<cfoutput>#xmlStr#</cfoutput>
</root>


That's it...piece of cake. The only weird things are the name of the
column that is returned by default is a bit odd, so I had to work
around that, and multiple records are returned representing one xml
document so they need to be concatenated.
If anyone has any info on how to change that or why that is, I'm all
ears.

-- 
mailto:[EMAIL PROTECTED]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to