question

rsampson avatar image
rsampson asked

ssis how to continue package when foreach loop does not find any files

Currently ForEach loop utilizing counter to see if a file exists with a pattern ( *.csv ) , gets "Warning: The For Each File enumerator is empty. The For Each File enumerator did not find any files that matched the file pattern, or the specified directory was empty." It then enters a constraint to check the file counter, if it equals zero, then it's supposed to move on to the next task , set a variable , and continue to send an email. Currently it finishes the set variable task and stops with success. Questions: Why am I seeing this behavior ? and how can I fix it ? Thanks
ssis
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

nidheesh.r.pillai avatar image nidheesh.r.pillai commented ·
So it sets a variable but it is not able to execute the send email task. Is this understanding correct?
3 Likes 3 ·
rsampson avatar image rsampson commented ·
Yes, it just stops after executing the expression task. What I was trying to do, after encountering an error condition, continue to set a message variable, email that message the abort the package.
0 Likes 0 ·
rsampson avatar image rsampson commented ·
Same response received, whether run as debug, interactive or from agent job. Got around the problem by incrementing a counter and using expression constraint as to counter value. Also moved message creation to before loop. Still looking for a better way to setup the email message body...
0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.