I need to read the value of node <IdChk> with the following code:
DECLARE @XML AS XML
SET @XML ='
<ListChk >
<IdChk>26</IdChk>
<IdChk>29</IdChk>
<IdChk>35</IdChk>
<obs>test</obs>
<Fol>10944</Fol>
</ListChk>'
SELECT Y.V.value('IdChk[1]','int') AS chk
FROM @XML.nodes('/ListChk') X(V)
CROSS APPLY X.V.nodes('IdChk') Y(V)
but the value this query return is null
What could be the problem?
