SSIS-get latest file from a group of files based on last modified date

  • Hi All,

    I have a set of csv files that is being backed up in a folder on daily basis.

    Say FOr eg:

    File Modified Data

    Country.csv 27/03/2013 09:00:01 AM

    Geography.Csv 27/03/2013 09:00:01 AM

    Product.csv 27/03/2013 09:00:02 AM

    CUsomer.cSV 27/03/2013 09:00:02 AM

    Country.csv 26/03/2013 09:00:02 AM

    Geography.Csv 26/03/2013 09:00:02 AM

    Product.csv 26/03/2013 09:00:01 AM

    CUsomer.cSV 26/03/2013 09:00:01 AM

    Country.csv 25/03/2013 09:00:02 AM

    Geography.Csv 25/03/2013 09:00:03 AM

    Product.csv 25/03/2013 09:00:01 AM

    CUsomer.cSV 25/03/2013 09:00:01 AM

    This way I have files backedup in the folder for 5 plus days...

    I'll have four packages to pick up the data from Country, Geography,Product and Customer and load the same in to four different tables...I am able to write a script code to identify the latest file from the path...But I wanted to hardcode the filename some where in the package, so that particualr package will check for the latest file (say Cusomer), it will search for all the Customer files and pick up the latest and load into db.

    Any help on this ?

    Thanks!

    I wanted to pick up the latest file from the folder and load the same into the database

  • not sure if this is the exact outcome you were hoping for but i would declare a variable for the file name, use file system task to move the file to another directory after being loaded to a table, that way you could probably hardcode the first part of the name of the file to be picked up i.e. customer*.csv to be loaded to the relevant table.

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

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