multiple files with some columns are same and some columns are different but i have to load all this columns into single columns how

  • multiple files with some columns are same and some columns are different but i have to load all this columns into single table which is having all columns how is it possible with ssis 2008 r2 by using single data flow

  • Can you please give some additional details like file structure etc ? If possible please sample post the i/p file data and the output that you are expecting ...

  • ..load all this columns into single columns ...

    Please explain what you mean by this.

    In general, for every different file format, you will need a separate dataflow. Multiple files with the same format can use the same dataflow, often by using a FOREACH container to loop round those files.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • data in file1 like this id,name,add and in file2 like this id,name,add,unit,sold and file3 is id,nam...,but i have all columns in one single destination table.and i want load this all data into my single destination.

  • How many files are we talking about and also how many different layouts?

    Multiple data flows (one per file type) is one way of handling this.

    Another is to send all of the data to a script component and use that to handle the layout variations, in a single dataflow. In this case, your base file connection should define the entire row as a single string, to avoid any meta data issues between files.

    Use a FOREACH container to iterate round the files (your dataflow will go in here).

    If your C# is decent, the scripted option is likely to be tidier, in my opinion.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • On the other hand, you could just use BULK INSERT pointed at different views that all point to the same table.

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

  • Hi,

    Actually i have 10 files which have 30 columns common in all files,but some files having additional colums that may be 10 columns only ,but i have this 40 columns in my destination table so i want to load this all files in single package.And if it is possible with script component please send code.i think it is clear now ..common colums in all files like this id,dealer name,addderes,............. and additional columns in file 1 is agent,sales no,and additional column in file 2 is product,..and in final destination table columns are id,dealer name,adderess,agent,sales no,product,(this table is having all columns).

  • And if it is possible with script component please send code ...

    It is possible, but I'm not going to write the code for you - unless you want to hire me as a consultant.

    Please take the time to do some research and have a go yourself. If you have specific implementation problems, feel free to post back and we will try to help.

    I can help with pseudo-code though:

    Foreach File

    Determine row format

    Foreach row

    Break row into columns based on row format

    Assign columns to output columns

    Next row

    Next File

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • The above assumes that:

    a) You have created appropriate output columns for your script component

    b) That the script component is running in synchronous mode (one row in = one row out)

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

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

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