title: How to transform the table columns to vertical data in Sql server tables?
body: <p>I would like to transform one Sql server table into another.</p>
  
  <p>Original table</p>
  
  <pre><code>    Period      Date          Portfolio   Benchmark
  
      Pre0Month   12/31/2014   -0.0001      -0.0025
      Pre1Month   11/31/2014    0.0122       0.0269
      Pre2Month   10/31/2014    0.0176       0.0244
  </code></pre>
  
  <p>After transformation</p>
  
  <pre><code>    Returns      Pre0Month   Pre1Month    Pre2Month
  
      Portfolio   -0.0001      0.0122       0.0176
      Benchmark   -0.0025      0.0269       0.0244
  </code></pre>