package to read/IMPORT the flat files in chronological order (older one first)

  • A folder contains 10 excel files with different dates.

    I want to create a package to read/import the files in chronological order (older one first) and insert records in to destination (sql server). File name has the date of the file.

    If the file name doesn’t has that date use file create time as file date.

    File name format : Filename<yyyymmdd>.xlsx (or) Filename.xlsx

    Please help me with few links or some code to read the same.

  • At first glance, you'll need to use the directory or filesystem commands in a script object to read the attributes of the file, edit a local SSIS variable used as an expression for a connection object, and then perform a load of the data. At the tail, archive it to another directory.

    Do this in a for loop using a condition and when you don't locate a file of the desired type/name template exit out of the loop.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

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

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