I have the following XML text:
<Elements>
<imported>
<product name="Software #">0 </product>
<product name="Hardware">1000 Pieces </product>
<product name="Parts">300 </product>
<product name="Wholes sales">1000</product>
<product name="Cars">Audi (10) Porche (22) Skoda (48)</product>
<product name="Final Report">0</product>
</imported>
</Elements>
This XML data is stored in a nvarchar(max)
column, and it looks like this:
I want to do a select statement (or store the info in a temp table) and display a more readable form of that XML data and extract the values of the XML nodes, something like:
Column1 | Column2
------------------
Software | 0
Hardware | 1000 pieces
I am using SQL Server 2008.