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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 formatting output xml

Author  Topic 

chedderslam
Posting Yak Master

223 Posts

Posted - 2009-11-06 : 10:02:48
I am trying to return xml from a query.

Here is what I have:
select top 10 1 as Tag, NULL as Parent,
l.entry_data as [root!1!entry_data]
from pos_data.sufi.dbo.pos_log l
inner join @rating_ids r
on l.pos_id = r.rating_id
where l.entry_type = 0
for xml EXPLICIT

The output looks like this:
<root entry_data="(data)">

I want it to be formed like this:
<root>
<entry_data>(data)</entry_data>
</root>

How do I get it formatted like that?

Thanks.

ranganath
Posting Yak Master

209 Posts

Posted - 2009-11-10 : 05:33:51
you can try with this

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=127403&SearchTerms=XML
Go to Top of Page
   

- Advertisement -