I'm using SQL Server 2008 and I'm having trouble getting all data out of this xml:
DECLARE @xml xml
SELECT @xml =
'<dlines id="1234">
<dline time="16h49" order="1">bladibla</dline>
<dline time="16h50" order="2">more bladibla</dline>
</dlines>'
I can get the values of the attributes of the dline element using:
SELECT TimeStr = dLine.value('@time', 'nvarchar(20)'),
OrderNo = dLine.value('@order', 'int'),
StatusStr = dLine.value('@status', 'nvarchar(20)'),
PeriodStr = dLine.value('@period', 'nvarchar(20)')
FROM @afpxml.nodes('/dlines/dline') as XTbl(dLine)
But how do I get the value of dline element itself (the 'bladibla1')?
Thnx a lot for your help!