Send an email when ForEachLoop Fails
Hi Gurus,
At Present Im looping through Excels and loading into db. But I have a requirement that, lets say in future if a file comes with different excel format my pkg fails.
Lets say today I have 10 files in a sourcefolder and 10th file is in different(wrong) format, After looping through and moving 9 files to Processed folder my pkg failed at 10th file. so, Here, I need to send the user an email mentioning that the job
has failed at this particular file.
Please help me with this.
August 3rd, 2012 12:02pm
precedence constraints (those arrows between task) can also be used for error flows (Double click it and check the Constraint options => Value => Failure). If a tasks fails
it will continue with the red error flow...
Or you could use
event handlers to do something when there is an error.Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com |
Twitter
Free Windows Admin Tool Kit Click here and download it now
August 3rd, 2012 12:24pm
Here is an example of your scenario. As SSISJoost mentioned either use Precedence Constraints or Event Handlers for this scenario. Personally would
use Precedence constraints as it give a graphical representation of the errored flows whilst Event handlers are somewhat "hidden". A preferred approach strictly from an operations perspective.http://btsbee.wordpress.com/
August 3rd, 2012 12:48pm
precedence constraints (those arrows between task) can also be used for error flows (Double click it and check the Constraint options => Value => Failure). If a tasks fails
it will continue with the red error flow...
Or you could use
event handlers to do something when there is an error.
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com |
Twitter
Thank you for yout time.
Well, I got it working. But my Message should include something about the filename at which my FELoop failed. Is it possible? If yes, how?
Please explain me.
Free Windows Admin Tool Kit Click here and download it now
August 3rd, 2012 2:02pm
What was your solution? If you added a send mail task outside the loop, the variable from the loop contains the last filename (the one that failed).Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com |
Twitter
August 3rd, 2012 4:53pm
What was your solution? If you added a send mail task outside the loop, the variable from the loop contains the last filename (the one that failed).
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com |
Twitter
Mi send my task is inside the loop like below: So, how to include that filename in the message now?
Free Windows Admin Tool Kit Click here and download it now
August 3rd, 2012 5:09pm
Hi all,
I found the variable which holds the file name, but Is there any possibilities that I can have some this User:Filename variable with some custom message without any code.
Please help me with this.
August 6th, 2012 9:06am
Hi Spartaa,
You could build the email message using an Expression in the Send Mail Task. Click the Expressions page, and add an expression for the property "MessageSource". Please note that you need to cast everything to string to make it work. Please refer to Todd C's
reply in the thread:
http://dbaspot.com/sqlserver-dts/409138-ssis-send-mail-task-format.html
Please feel free to ask if you have any question.
Thanks,
Eileen
Free Windows Admin Tool Kit Click here and download it now
August 12th, 2012 12:15am
Hi Spartaa,
You could build the email message using an Expression in the Send Mail Task. Click the Expressions page, and add an expression for the property "MessageSource". Please note that you need to cast everything to string to make it work. Please refer to Todd C's
reply in the thread:
http://dbaspot.com/sqlserver-dts/409138-ssis-send-mail-task-format.html
Please feel free to ask if you have any question.
Thanks,
Eileen
August 12th, 2012 12:22am