SQLTeam.com | Weblogs | Forums

Using attribute value to select xml block

Hi, in the below example, I need to fetch <Name> value for which the EcinRecordID=1042893. Please let me know how to achieve this. is the below statement correct?


   <Finding EcinRecordID="1042893">
      <Name>Goal Length of Stay for the ORG</Name>
      <Selected Value="0" DisplayValue="No"/>
   <Finding EcinRecordID="1042894">
      <Name>Goal Length of Stay for the GRG</Name>
      <Selected Value="1" DisplayValue="Yes"/>
      <NoteText>3 days</NoteText>

Duplicate - re-posted here:


Locked. Please see the other thread.