title: Unpivot ALL Columns in a SQL Table
body: <p>I have a table with 30 columns and I want to easily unpivot ALL columns. I understand I can use this strategy:</p>
  
  <pre><code>SELECT col, value 
  INTO New_Table
  FROM
  (SELECT * FROM Test_Data) p
  UNPIVOT
  (value FOR col IN (Column_Name1, Column_Name2... Column_Name30)) as unpvt
  </code></pre>
  
  <p>This is how my data comes in:</p>
  
  <pre><code>Column_Name1    Column_Name2    Column_Name3
  Value11         Value21         Value31
  Value12         Value22         Value32
  Value13         Value23         Value33
  </code></pre>
  
  <p>This is how I want to store it in the new table:</p>
  
  <pre><code>New_Column1    New_cloumn2
  Column_Name1   Value11
  Column_Name1   Value12
  Column_Name1   Value13
  Column_Name2   Value21
  ...
  </code></pre>
  
  <p>But there must be an easier way than typing in the 30 column names.</p>
  
  <p>Thanks in advance.</p>