title: How to get a particular attribute from XML element in SQL Server
body: <p>I have something like the following XML in a column of a table:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;container&gt;
    &lt;param name="paramA" value="valueA" /&gt;
    &lt;param name="paramB" value="valueB" /&gt;
    ...
  &lt;/container&gt;
  </code></pre>
  
  <p>I am trying to get the valueB part out of the XML via TSQL</p>
  
  <p>So far I am getting the right node, but now I can not figure out how to get the attribute.</p>
  
  <pre><code>select xmlCol.query('/container/param[@name="paramB"]') from LogTable
  </code></pre>
  
  <p>I figure I could just add /@value to the end, but then SQL tells me attributes have to be part of a node. I can find a lot of examples for selecting the child nodes attributes, but nothing on the sibling atributes (if that is the right term).</p>
  
  <p>Any help would be appreciated.</p>