Need to create script task to check for the source files-Arrival

  • Hi techies,

    I need to create script task to check the source files arrival.

    For Ex:

    The task should check weather files are present at the path.

    If the files are not arrived, it should check repeatedly for few times having interval of time between each check say 10 mins.

    finally the mail should be sent stating the files is not arrived.

    i am finding it difficult to implement, as i am not good with scripts.

    Your input is much appreciated. Please help.

  • You can use System.IO.File.Exists(yourFilePath) to check whether the file you are after exists in the given path. This can be done in a loop with a sleep - System.Threading.Thread.Sleep(yourTimeout).

    Note that all of this can be done without a script task. You can use the File System Task to check whether the file exists, a loop container to try a few times, an Execute SQL task to do the sleep (e.g. WAITFOR DELAY '00:00:10') and a Send Mail task to send the email.

  • Have you checked File Watcher Task?

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • Sorry I actually don't think the File System Task supports checking if a file exists.

  • Paul_J (9/7/2009)


    Sorry I actually don't think the File System Task supports checking if a file exists.

    Paul,

    This is the custom File Watcher Task, not the File System Task. And it supports the needed functionality.

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • CozyRoc (9/7/2009)


    Paul_J (9/7/2009)


    Sorry I actually don't think the File System Task supports checking if a file exists.

    Paul,

    This is the custom File Watcher Task, not the File System Task. And it supports the needed functionality.

    Sorry for the confusion, but I was referring to my earlier post where I incorrectly implied that the File *System* Task would support checking file existence.

  • Guys many thanks for a quick reply..

    Well i definetely try your suggestions.

    You guys rock....:-)

    Cheers,

    Aravind

Viewing 7 posts - 1 through 6 (of 6 total)

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