Loop through Task

  • I have a SSIS package that imports a flat file into my database. What I'm looking for is a task that could look for the input source file and run the remaining tasks of the package as soon as it finds the source file. I have already tried using File Watcher Task but it doesn't work for me. Any alternate suggestions will be highly appreciated

  • What is the issue you are having?

  • [font="Comic Sans MS"]

    This is not a very good approach but an alternative.

    1) Use a foreach loop container to loopthrough the file(s) - if found it will process.

    2) (Optional) If file not found - have a precedence constraint defined in case the file is not found - and if you wish to perform any work(log etc).

    3)Create a driver package to fire this actual package - only if a particular flag - say database flag is not set.

    4)Schedule the driver package to execute in 'infinite' (!) loop ... introduce delay compontnt etc ..

    [/font]

    [font="Comic Sans MS"]--
    Sabya[/font]

  • In SSIS 2008, you could try with the WMI Event Watcher Task which watches for WMI events returns the status. There is a way to setup a timeout.

    Drag the WMI Event Watcher Task to the Control Flow, Set up the WMI options Connections. and the WqlQuerySource property.

    You can find the sample code in the SQL Server 2008 books online documentation. It is very easy to setup. Here is the link

    Link

    Correction. It can be done in SSIS 2005 as well. Here is the link

    Link 2005

Viewing 4 posts - 1 through 3 (of 3 total)

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