How to convert columns into rows

  • select'1111' as First, '2222' Second, '3333' Third, '4444' Fourth, '5555' Fifth,

    '6666' as Sixth, '7777' Seventh, '8888' Eighth, '9999' Nineth, '1234' Tenth,

    '5678' as Eleven, '910' Twelve, '2345' Thirtheen, '7564' Fourteen, '9739' Fifteen

    Is there any way to convert these columns into Rows with different column name? There are nearly two hundred columns in my table.

  • Take a look at the UNPIVOT operation. Unfortunately, you will have to list all columns by name.

    http://msdn.microsoft.com/en-us/library/ms177410.aspx

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply