title: How to switch "rows value" to "columns" in database?
body: <p>I use SQL Server 2008. Here is my SQL:</p>
  
  <pre><code>SELECT [CIExtendedAttributeID]
        ,[dbo].[CIExtendedAttribute].[CreatedBy]
        ,[dbo].[CIExtendedAttribute].[CreationDate]
        ,[dbo].[CIExtendedAttribute].[ModifiedBy]
        ,[dbo].[CIExtendedAttribute].[ModificationDate]
        ,[ConfigurationItemID]
        ,[Value]
        ,[dbo].[CIExtendedAttribute].[CIExtendedAttributeTypeID]
        ,[dbo].[CIExtendedAttributeType].DescrEN
    FROM [dbo].[CIExtendedAttribute]
    INNER JOIN [dbo].[CIExtendedAttributeType] ON [dbo].[CIExtendedAttribute].CIExtendedAttributeTypeID = [dbo].
  
  [CIExtendedAttributeType].[CIExtendedAttributeTypeID]
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>the result :
  
  CIExtendedAttributeID CIExtendedAttributeTypeID          DescrEN                       VALUE
   0                              1                         MAC adress                  000B6XXXXX8
   1                              1                         ESN                         100B6XXXXX8
   2                              2                         Display                     19"
   3                              2                         MAC adress                  100B6XXXXX9
  
  
  I would like :
  
  TESTCIExtendedAttributeID  TESTCIExtendedAttributeTypeID    MAC adress      ESN            Display
   0                              1                           000B6XXXXX8     100B6XXXXX8    NULL                              
   2                              2                           100B6XXXXX9            NULL    19"</code></pre>
  </div>
  </div>
  </p>
  
  <p>I would like to switch the rows value to columns. The example is very light but the reality is another thing. This may be in another table or anything else. I can export to Excel too.</p>
  
  <h2>SQL Fiddle ##  <a href="http://sqlfiddle.com/#!3/cebdd/1" rel="nofollow">here</a>.</h2>