I need to get the values of Step0-to-Step1_Variance,Step1-to-Step2_Variance from the above XML:
I tried with the query in the attached picture, but getting NULL value
I need to get the values of Step0-to-Step1_Variance,Step1-to-Step2_Variance from the above XML:
I tried with the query in the attached picture, but getting NULL value
I suppose in your actual xml there is one TMAs
element with zero or more TMA
children. You could select them like so:
SELECT tma.value('(./ActualMin_Step0-to-Step1/@Step0-to-Step1_Variance)[1]', 'INT')
FROM ...
CROSS APPLY tbl.xml.nodes('/myFields/Page3/TMAs/TMA') AS x(tma)
there is no query, but I imagine you have an XML as below :
<Root>
<row id="1"><name>Larry</name><oflw>some text</oflw></row>
<row id="2"><name>moe</name></row>
<row id="3" />
</Root>
and you need to get name tag.
DECLARE @x xml
SET @x='<Root>
<row id="1"><name>Larry</name><oflw>some text</oflw></row>
<row id="2"><name>moe</name></row>
<row id="3" />
</Root>'
SELECT T.c.query('.') AS result
FROM @x.nodes('/Root/row') T(c)