sql - How to remove column name when selecting from a XMLTYPE column using FOR XML PATH -


i have table xmltype column named 'invoicexml'.

the data in column xml in form:

<invoice customernum="1234" > <customdeliverydetails /> </invoice> 

when

select ... xml path(''), root('invoices')  

i end with:

<invoices>  <invoicexml>   <invoice customernum="1234" >   <customdeliverydetails />   </invoice>  </invoicexml> </invoices> 

how stop column name invoicexml appearing in output?

declare @t table (invoicexml xml)  insert @t values (   '<invoice customernum="1234" >      <customdeliverydetails />    </invoice>   ')  insert @t values (   '<invoice customernum="4321" >      <customdeliverydetails />    </invoice>   ')  select (select t.invoicexml) @t t xml path(''), root('invoices') 

edit 1 subqeery (select t.invoicexml) has no column name removed.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -