title: MS SQl Create columns based on values in rows
body: <p>I have a table:</p>
  
  <pre><code>   --ID----ID2----Error
        1     1      A
        1     2      B
        1     3      A
  </code></pre>
  
  <p>What i want:</p>
  
  <pre><code> ---ID---ErrorTypeA---ErrorTypeB---
      1         2            1
  </code></pre>
  
  <p>I don't know how many ErrorType there is, so they should be created dynamically based on the distinct values in Error column....Is that possible?</p>