Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 XML Help

Author  Topic 

Gigi
Starting Member

23 Posts

Posted - 2009-04-03 : 13:11:11
I have a table which is ready with the data I need and I need to spit out all the data as an XML. I am not able to exhibit the data the way I want using various SQL compatible XML commands. The format I need is shown below. Any help would be greatly appreciated
- <table1>
<col1>some data</col1>
<col1>some data</col1>
<col2>some data</col2>
<col3>some data</col3>
<col4>some data</col4>
<col5>some data</col5>
<col6>some data</col6>
<col7>some data</col7>
<col8>some data</col8>
<col9>some data</col8>
<col10>some data</col10>
<col11>some data</col11>
<col12>some data</col12>
<col13>some data</col13>
</table1>
- <table1>
<col1>some data</col1>
<col1>some data</col1>
<col2>some data</col2>
<col3>some data</col3>
<col4>some data</col4>
<col5>some data</col5>
<col6>some data</col6>
<col7>some data</col7>
<col8>some data</col8>
<col9>some data</col8>
<col10>some data</col10>
<col11>some data</col11>
<col12>some data</col12>
<col13>some data</col13>
</table1>

and so on.... with all the rows of data I have

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-04-03 : 13:20:15
make use of FOR XML clause. have a look at syntax in books online
Go to Top of Page

Gigi
Starting Member

23 Posts

Posted - 2009-04-03 : 13:37:05
i did that...not working
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-04-03 : 13:39:43
show the code used
Go to Top of Page

Gigi
Starting Member

23 Posts

Posted - 2009-04-03 : 14:28:01
it had something worng in my select...its working now...thanks for your help
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-04-04 : 00:11:08
Show what ever you did(tried) till now show your query there ....
it will help us to recognize your problem in efficient way,,,
Thanks...
Go to Top of Page
   

- Advertisement -