title: How to select xml data from a sql table
body: <p>I'm trying to write a sql query to get results as follows from a xml data type column in MS Sql Server 2012 database table
  Data is stored in the database as follows</p>
  
  <pre><code>ID  |Summary
  ==========================
  1   |&lt;Summary&gt;&lt;Field Key="Col1" Value="S1" /&gt;&lt;Field Key="Col2" Value="N" /&gt;&lt;/Summary&gt;
  2   |&lt;Summary&gt;&lt;Field Key="Col1" Value="S2" /&gt;&lt;Field Key="Col2" Value="Y" /&gt;&lt;/Summary&gt;
  </code></pre>
  
  <p>I need a result set of records as follows</p>
  
  <pre><code>ID    |    Col1      |  Col2
  ==========================
  1     |    S1        |  N
  2     |    S2        |  Y
  </code></pre>
  
  <p>Can you please help me to sort this out?</p>