title: SQL 2008 retrieving attribute values from an XML column
body: <p>Specifically, given the following XML content in a column called metadata, how do I retrieve the value of nodes with a specific name attribute?</p>
  
  <p>In this case I'm after the value associated with the int16_t tag and a name of 'filterIndex'</p>
  
  <pre><code>&lt;root version="1"&gt;
    &lt;class derived_type="FilterInfo" name="FilterInfo"&gt;
      &lt;string name="filterName" length="3" value="mt8" /&gt;
      &lt;string name="filterText" length="3" value="SVR" /&gt;
      &lt;string name="filterTable" length="11" value="CML_5_1_mt8" /&gt;
      &lt;bool name="userDefined" value="true" /&gt;
      &lt;bool name="multiResp" value="false" /&gt;
      &lt;enumeration name="filterType" value="1" /&gt;
      &lt;enumeration name="filterCategory" value="1" /&gt;
      &lt;vector name="options" count="1"&gt;
        &lt;class derived_type="OptionInfo" name="V0"&gt;
          &lt;int16_t name="optionIndex" value="1" /&gt;
          &lt;string name="optionName" length="3" value="mt8" /&gt;
          &lt;string name="optionText" length="3" value="SVR" /&gt;
          &lt;string name="optionTable" length="11" value="CML_5_1_mt8" /&gt;
        &lt;/class&gt;
      &lt;/vector&gt;
      &lt;GUID name="primaryKey" value="fe66b60f-468a-4f0e-be80-0055e20baa35" /&gt;
      &lt;int16_t name="filterIndex" value="1080" /&gt;
    &lt;/class&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>Thx++</p>
  
  <p>Jerry.</p>