Synchronous read of flat files to table ??

  • Hi..

     

    I have a problem I would be very glad someone could help me out with..Im pretty new to SQL 2005 and the new SISS packages...know the "old" DTS well, but havent got over the hurdles with the 2005 way of handling things...

    This it what I would like to achieve....I have a folder on my DB server containing a number of text files....these textfiles contain updated customer information......i need to find a way of creating an integration package that on a schedules basis (like every 20 minutes) checking for files in this directory...if the filename starts with an "Z" I will read the content and put it into a dedicated table......also, if there are multiple files starting with "Z" in the file name I NEED to read them in the correct sequential order according to the date/time stamp of the flat file creation properties.....

    As soon as a file is read and imported to my DB table I would like to move this particular flat file to another file folder (for all imported files)

    I know there are some File enumeration collection whatever thing in SQL 2005 SISS packages..but how on earth could I create the above described business flow ??

    Extremely greatful for help with some examples about how I can solve this.

    BR

    Helmut

  • It's all pretty doable.

    Your biggest rule is the file starting with Z. This however is quite simple as well.

    The for each loop will give you the file names of all the files in a directory.

    To apply the logic, you have to methods:

    Using a precedent constraint, and the expression capabilities in that, you can decide on what to load and what not to.

    You could also use a script task and write far more complex logic in that. Use that to decide on what to do with the files.

    As for the Z and ordering, the task gives you the files, oldest first. It is ordered by the creation date.

    As for the scheduling, look at SQL agent. nothing different to DTS.

    HTH

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

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

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