Here’s my XML:
DECLARE @ChargeDetail xml
SET @ChargeDetail ='
<Amount>
<First>
<Second>1</Second>
<Second>2</Second>
</First>
</Amount>'
and I’m using this query:
SELECT tc.value('Second[1]','varchar(max)') as ID
FROM @ChargeDetail.nodes('/Amount/First') as tb(tc)
I want the output to be:
ID
1
2
but this query return only 1
pls help me in this….
Thanks in advance.
1 Answer