title: SQL Server : Columns to Rows
body: <p>Looking for elegant (or any) solution to convert columns to rows.</p>
  
  <p>Here is an example: I have a table with the following schema:</p>
  
  <pre><code>[ID] [EntityID] [Indicator1] [Indicator2] [Indicator3] ... [Indicator150]
  </code></pre>
  
  <p>Here is what I want to get as the result:</p>
  
  <pre><code>[ID] [EntityId] [IndicatorName] [IndicatorValue]
  </code></pre>
  
  <p>And the result values will be:</p>
  
  <pre><code>1 1 'Indicator1' 'Value of Indicator 1 for entity 1'
  2 1 'Indicator2' 'Value of Indicator 2 for entity 1'
  3 1 'Indicator3' 'Value of Indicator 3 for entity 1'
  4 2 'Indicator1' 'Value of Indicator 1 for entity 2'
  </code></pre>
  
  <p>And so on..</p>
  
  <p>Does this make sense? Do you have any suggestions on where to look and how to get it done in T-SQL? </p>