sql - How to make child as parent in xml tree -


i working on message broker. query doing simple , can answered db guy .

here query code read xml , getting xml output

set outputroot.xmlnsc.root.row[rowcnt].product_info = (select the(select c.*:codes.*:code tyrepatterncd t.*:classification[] c                      c.(xmlnsc.attribute)type = 'brand') product                 itemmaster.*:itemmasterheader[] t ); 

this gives xml output

<root name="product">  <row>   <product_info>    <product>     <tyrepatterncd>002</tyrepatterncd>    </product>      </row> </root> 

how can make

   <root name="product">      <row>       <product_info>         <tyrepatterncd>002</tyrepatterncd>        </row>     </root> 

if remove as product in query makes column tag in tree. how can make child parent?

use select item omit 'product' element, , directly assign result.

set outputroot.xmlnsc.root.row[rowcnt].product_info = (select item the(select c.*:codes.*:code tyrepatterncd t.*:classification[] c                      c.(xmlnsc.attribute)type = 'brand')                 itemmaster.*:itemmasterheader[] t ); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -