Pivot Transformation

  • I have a table like this:

    ---------------------------------------

    TableName

    ----------------------------------------

    Column1 Column2 Column3

    ----------------------------------------

    Row1

    Row2

    Row3

    ----------------------------------------

    How can i make columns to Rows like this:

    ---------------------------------------

    TableName

    ----------------------------------------

    Single COlumn

    ----------------------------------------

    Column1

    Column2

    Column3

    ----------------------------------------

    Any Idea How to use Pivot to do this:

    Pls lemme know steps.

    Thnx in Adv

    [font="Comic Sans MS"]
    ---------------------------------------------------

    Thanks [/font]

  • Use UnPivot.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

  • Can u brief me how to use it in such scenario..i know a litle bit settin lineage ID

    Thanks

    [font="Comic Sans MS"]
    ---------------------------------------------------

    Thanks [/font]

  • Hi Kajal,

    If you do a google search on "SSIS Pivot" you will find there are quite a number of articles dedicated to this subject.

    Why don't you have a look through them and come back with any questions you have?

    Cheers

    Kindest Regards,

    Frank Bazan

  • Kajal (8/28/2008)


    Can u brief me how to use it in such scenario..i know a litle bit settin lineage ID

    Thanks

    Anything I say would be a simple regurgitation of what's in Books Online. Recommend you start there, first.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

Viewing 5 posts - 1 through 4 (of 4 total)

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