SSIS - Loading files order by date

  • Hi,

    My folder structure - -

    A20110301.txt

    A20110302.txt

    A20110303.txt

    B20110301.txt

    B20110302.txt

    B20110303.txt

    C20110301.txt

    C20110302.txt

    C20110303.txt

    As of now i am loading the files in the below order

    A20110301- 03 , B20110301-03, C20110301-03. i.e All the files of table A and all the files of table B...

    But i need to load them in - -

    A20110301 , B20110301, C20110301

    ||

    A20110302 , B20110302, C20110302

    ||

    A20110303 , B20110303, C20110303

    Can you please suggest how can i change my existing pkg in incorporate the above logic. i.e load files from A-C order by date.

    Thanks,

    Narendra

  • A possible solution:

    read the directory contents with a script task and store all the filenames in a table in the order that you want.

    Then loop over the table with a for each loop and import each file according to the order you specified in the table.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

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

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