For each Loop container in SSIS

  • Hi All,

    Here is my Task....

    We have One main folder and 12 different sub-folder. Each sub folder will have one file. These files are refreshed weekly. There is also an arcival proccess which will archive all the files weekly.

    My task to check whether the file exists in the folder.If exists send send an email notification to the consumer,if a file does not exists then send an email notification to Source Team. I am using for each loop container, but this container always shows green even though some of the file are missing in the folders. It just give warning message in the log.

    Could you please suggest me to send an email to Source team whenever a file is missing.

    Thanks!

  • We have One main folder and 12 different sub-folder. Each sub folder will have one file. These files are refreshed weekly. There is also an arcival proccess which will archive all the files weekly.

    My task to check whether the file exists in the folder.If exists send send an email notification to the consumer,if a file does not exists then send an email notification to Source Team. I am using for each loop container, but this container always shows green even though some of the file are missing in the folders. It just give warning message in the log.

    Could you please suggest me to send an email to Source team whenever a file is missing.

    Thanks!

    This can be done using script task in the control flow. Inside the script task you can create 12 variable of boolean variable type and store the result of the existence of the files in the 12 sub-folders using File.Exists command. Then connect the output of the script task to the 12 send email task with the precedence constraint of the appropriate bool variable to be true.

    You can also achieve this with two variables and two send email tasks if you can able to tweak the code dynamically to contain the folder name or if you just want to send email regardless of which folder the file is not available.

    [font="Arial"]BASKAR BV
    http://geekswithblogs.net/baskibv/Default.aspx
    In life, as in football, you won’t go far unless you know where the goalposts are.[/font]

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

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