posts - 18, comments - 23, trackbacks - 1

My Links

News

This blog has moved to http://shailen.sukul.org

Article Categories

Archives

Post Categories

September 2006 Entries

How to use FOR XML to return an Xml Document with a root element
The query below shows how to create an XML document using FOR XML from a table (based on Sql Server 2000). To start with, run the sql script further below to create the sample table, and populate it with some data. Once the select script is run, data will be returned in the form: <Employees> <Employee> <field1></field1> ... </Employee> </Employees> Query select 1 as Tag, NULL as Parent, NULL as [Employees!1!Employee!xml], NULL as [Employee!2!OfficerId!xml], NULL...

Posted On Thursday, September 07, 2006 11:20 AM | Feedback (0) | Filed Under [ Database ]

Powered by: