Asked By geir
04-Nov-09 05:13 PM
Hi all.
I just cannot get to the item values and hope anyone can help me. Here is the
XML i have got into at one row tabel an XML datatype column.
CREATE TABLE #LevInfoXML (pk int primary key identity, XmlCol xml)
The following 2 examples just give me NULL as values.
SELECT ThiemeItemCode = R.ref.value('@ThiemeItemCode', 'nvarchar(64)')
FROM #LevInfoXML cross apply xmlcol.nodes('//Item') as R(ref)
AND
SELECT ItemStocks.Item.value('@ThiemeItemCode', 'varchar(20)')
FROM
@XML.nodes('/ItemStocks/Item') AS ItemStocks(Item)
This should be really simple, but I just cant get to the items values.
--
Thanks all
Regards Geir