Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. how to convert column to row in SQL Server 2005

how to convert column to row in SQL Server 2005

Scheduled Pinned Locked Moved Database
databasesql-serversysadminhelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chetan visodiya
    wrote on last edited by
    #1

    I have the following result set in sql server 2005. Column1 column2 column3 column4 cc cc1 cc2 cc3 dd dd1 dd2 dd3 Now I want to convert above result into the following table without using cursor in SQL Server 2005. column1 cc dd column2 cc1 dd1 column3 cc2 dd2 column4 cc3 dd3 Please help me.

    M 1 Reply Last reply
    0
    • C Chetan visodiya

      I have the following result set in sql server 2005. Column1 column2 column3 column4 cc cc1 cc2 cc3 dd dd1 dd2 dd3 Now I want to convert above result into the following table without using cursor in SQL Server 2005. column1 cc dd column2 cc1 dd1 column3 cc2 dd2 column4 cc3 dd3 Please help me.

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Look into unpivot, I've never actually had to do this but pivot work fine so I assume unpivot will also.

      Never underestimate the power of human stupidity RAH

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups