title: SQL transpose full table
body: <p>I need to do the following transpose in MS SQL</p>
  
  <p>from:</p>
  
  <pre><code>Day  A  B 
  ---------
  Mon  1  2
  Tue  3  4
  Wed  5  6
  Thu  7  8
  Fri  9  0
  </code></pre>
  
  <p>To the following:</p>
  
  <pre><code>Value Mon Tue Wed Thu Fri 
  --------------------------
  A      1   3   5   7   9
  B      2   4   6   8   0
  </code></pre>
  
  <p>I understand how to do it with <code>PIVOT</code> when there is only one column (A) but I can not figure out how to do it when there are multiple columns to transpose (A,B,...)</p>
  
  <p>Example code to be transposed:</p>
  
  <pre><code>select LEFT(datename(dw,datetime),3) as DateWeek, 
    sum(ACalls) as A, 
    Sum(BCalls) as B 
  from DataTable
  group by LEFT(datename(dw,datetime),3)
  </code></pre>
  
  <p>Table Structure:</p>
  
  <pre><code>Column DataType
  DateTime Datetime
  ACalls int
  BCalls int
  </code></pre>
  
  <p>Any help will be much appreciated.</p>