how to send rows to columns data in ssis

  • hi friends,

    source data comes like id,name,location

    10,ravi,hyd

    11,nagi,chen

    12,mali,bang

    13,venu,pune

    i want target table data like col1 col2 col3 col4

    10 11 12 13

    ravi nagi mali venu

    hyd chen bang pune

    how to solve this problem in ssis plese tell me the process

  • Duplicate post

    Investigate the Pivot task

  • pivot is not working

  • We're not mind readers here. With no information, how would you expect anyone to help you? Did you get an error? How is it not working?

  • boss if u dont mind plz tell me the process by useing pivot

  • No one here is your boss. Take a look at:

    http://www.jasonstrate.com/2011/01/31-days-of-ssis-pivot-transformation-1031/

  • asranantha (9/19/2011)


    hi friends,

    source data comes like id,name,location

    10,ravi,hyd

    11,nagi,chen

    12,mali,bang

    13,venu,pune

    i want target table data like col1 col2 col3 col4

    10 11 12 13

    ravi nagi mali venu

    hyd chen bang pune

    how to solve this problem in ssis plese tell me the process

    What do you want done if you have more or less than 4 pairs of data?

    --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)

  • You can try using component named script component

    Code for you reference :

    Dim keyField As Integer = Row.KeyField

    Dim itemList As String = Row.ListField

    Dim delimiter As String = ","

    If Not (String.IsNullOrEmpty(itemList)) Then

    Dim inputListArray() As String = _

    itemList.Split(New String() {delimiter}, _

    StringSplitOptions.RemoveEmptyEntries)

    For Each item As String In inputListArray

    With Output0Buffer

    .AddRow()

    .KeyField = keyField

    .ListItem = item

    End With

    Next

    End If

    End Sub

Viewing 8 posts - 1 through 7 (of 7 total)

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