Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 24th, 2006, 02:10 AM
Authorized User
 
Join Date: Dec 2005
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to kapi.goel
Default SQL Table to XML Document

Hi Experts,

Can anybody tell me the code for converting the table
records to a XML document.

I want to write a procedure which will return a string
( varchar(8000) )
containing the xml document.

The Sample XML document i need in the form of string is:

<QATollFreeLocations>
    <LocationName>USA</LocationName>
    <LocationNumber>123456453478</LocationNumber>
</QATollFreeLocations>


Please guide me with an example

Regards,

KG
__________________
KG
 
Old April 27th, 2006, 07:24 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi

Guess a bit late while responding, but the most simple option you can use is within your select statement, i.e.

select * from table for XMLAUTO

(In place of * use your field names, and in place of table use your table name)

If you need more generalized XML conversion, do let me know.

Regards
Mike






Similar Threads
Thread Thread Starter Forum Replies Last Post
XMl Document Reading in SQL Server shashideore SQL Server 2005 1 April 26th, 2007 07:16 AM
create 2-columns table from an XML document frosty1575 XSLT 2 May 16th, 2006 04:17 AM
Write Nested XML document into SQL Server tables boondocksaint20 VB.NET 0 May 2nd, 2006 12:35 PM
SQL Table to XML Document kapi.goel SQL Server 2000 5 April 25th, 2006 06:33 AM
SQL Table to XML Document kapi.goel XML 4 April 24th, 2006 08:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.