how to import excel data to SSIS

  • I have some excel sheet to import into sql server 2005.

    But is it possible to tell SSIS to create a column called conatct_id and add a constant value like 1 to it plus another column with an incremental value

    So excel sheet e.g

    a b

    -- --

    boy girl

    and into sql i want to have

    id contactid a

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

    1 1 boy

    2 1 aunty

    any ideas would be appreciated

    Thanks

  • hey patrick if u need to add an additional column other than from the excel u can use derived column ...if u go tit tast fine if not let me know....

    Thanks,
    Chinna

    Its the Journey which gives you Happiness not the Destination-- Dan Millman

  • Hi Patrick,

    To add a constant for your contact_id, you could do this by using a JET SQL Command for your excel source:

    SELECT

    F1 AS Col1,

    F2 AS Col2,

    1 AS ContactId

    FROM [Worksheet$]

    To add a row number you can use a script transformation in the dataflow which increments for each row that passes through it.

    If what you're saying is that you want to normalise the data from the spreadsheet and transform the columns into rows, then you will need to pass the data through the pivot component.

    HTH

    Kindest Regards,

    Frank Bazan

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

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