I need to get the childnode values of users with multiple keys, as shown below:
<Individuals>
<User key="0">
<UserlID>100</UserlID>
<FirstName>John Doe</FirstName>
</User>
<User key="1">
<UserlID>101</UserlID>
<FirstName>Jane Doe</FirstName>
</User>
<User key="2">
<UserlID>102</UserlID>
<FirstName>Jack Black</FirstName>
</User>
</Individuals>
My desired result will be either, three rows of all key-s UserID-s or one row concatenating all three key UserID-s. the number of the key is variable, maybe more than three.
Have managed to get static UserID values:
SELECT
[UserID] = A.XmlField.value('(Individuals/User[@key=2]/UserlID)[1]', 'Int')
FROM [MyTable] As A
but the problem is I cannot get all the userID-s