I am needing to query for all the id values in the XML column below and needing some help doing that. How do I use the index values in my select statement? Any help/direction would be appreciated. Thanks.
Here is the XML file:
<rotation>
<adjuster id="3381" index="0" />
<adjuster id="7629" index="1" />
<adjuster id="10087" index="2" />
<adjuster id="10741" index="3" />
<adjuster id="11544" index="4" />
<adjuster id="12367" index="5" />
</rotation>
Here is my select statement but only getting the first value returned:
select
t.AssignmentRotation.value('(/rotation/adjuster/@id)[1]','varchar(max)') as adjuster_id
from
dbo.CMS_AdjusterTeam t
where
t.AdjusterTeamSysID IN (5, 6);