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.
Author |
Topic |
DeepakNewton
Starting Member
39 Posts |
Posted - 2008-05-21 : 14:26:53
|
Dear All,I would like to get the solution for the below sample datain the TablePARAMID DETID FKID Desc Type Name value 1 1 1 A St PersonalName Raj2 1 1 A dt Date 12/30/20073 1 1 A St age 23 1 2 1 A St PersonalName vimal2 2 1 A dt Date 12/30/20073 2 1 A St age 254 3 2 B st companyName xyz5 3 2 B st Add MumbaiNow i would like to get the result in the XML format as <Report><DETID @id=1><DESC>A</DESC><TYPES><PARAM @ID=1><TYPE>ST</TYPE><NAME>PersonalName</NAME><Value>Raj</AGE></PARAM><PARAM @ID=2><TYPE>DT</TYPE><NAME>Date</NAME><Value>12/23/2008</Value></PARAM><PARAM @ID=3><TYPE>ST</TYPE><NAME>AGE</NAME><Value>25</Value><PARAM><TYPES>...</DETID><DET@id=2><DESC>A</DESC>..</Report>Please give a solution |
|
cat_jesus
Aged Yak Warrior
547 Posts |
Posted - 2008-05-21 : 16:04:48
|
Did you look at "for XML" in Books Online?An infinite universe is the ultimate cartesian product. |
 |
|
|
|
|