Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
xml report generation using sql
madhukeshwar murkibhavi
Dec 20 2014 5:17 AM
525
Reply
I Have a Table with 3 fields ID,name, city, for generating xml for mentioned fields, i have written query like below
select ID,name,city from Table For XML RAW('IDS'),elements,root('Cities'),
for the above i m getting output as follows
<Cities>
<IDS>
<ID> 1 </ID>
<name> name1 </name>
<city> city1 </city>
</IDS>
</Cities>
The Above output is fine but now the question is i have assigned particular ID for particular city and the cities under same Id Must be in single element
i Mean i Want output as below
<Cities>
<IDS>
<ID1>
<name> name1 </name>
<city> city1 </city>
<name> name2 </name>
<city> city2 </city>
<name> name3 </name>
<city> city </city>
</ID1>
</IDS>
</Cities>
The name1,name2,name3 and city1,city2,city3 are belonging toThe ID1 can anybody help me get the output as above please.....
Thanks In Advance
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
caliburn micro sample
disable click event everywhere when Process Ring is Active