How to break out of a sequence container
Hi,
You can use Event Handler or a script task to do this.
Event Handlers Basics- http://www.simple-talk.com/sql/ssis/ssis-event-handlers-basics/
Throwing errors from Script Task component - http://consultingblogs.emc.com/jamiethomson/archive/2005/11/03/SSIS_3A00_-Throwing-errors-from-script-task_2F00_component.aspx
Hope this helps!Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com
July 5th, 2012 11:34am
I have a sequence container. In it, I do a bunch of load logic. The sequence container has 2 precedent contraints coming out of it. One for succeeded and the other for failure.
Now, besides any container errors within the sequence container, I also want to somehow raise an error, if certain conditions aren't met. How can I do that so that the error is raised to the sequence container and cause the control flow to go down
the failure constraint path?
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2012 1:44pm
Hi,
You can use Event Handler or a script task to do this.
Event Handlers Basics- http://www.simple-talk.com/sql/ssis/ssis-event-handlers-basics/
Throwing errors from Script Task component - http://consultingblogs.emc.com/jamiethomson/archive/2005/11/03/SSIS_3A00_-Throwing-errors-from-script-task_2F00_component.aspx
Hope this helps!Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com
July 6th, 2012 1:57pm
See how to gracefully handle errors in the sequence container:
http://sqlblog.com/blogs/rushabh_mehta/archive/2008/04/24/gracefully-handing-task-error-in-ssis-package.aspxArthur My Blog
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2012 2:02pm
You can use an Execute SQL task to accomplish that.
For example, let's say a you have task and if it completes successfully, you'd like to log "Moving on" as the message in your log table. You can simply connect your task to an Execute SQL task(use Precedence constraint "Success")and
write an inset statement that writes to your log table. Hope this helps!Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com
July 6th, 2012 4:24pm
Hi,
You can use Event Handler or a script task to do this.
Event Handlers Basics- http://www.simple-talk.com/sql/ssis/ssis-event-handlers-basics/
Throwing errors from Script Task component - http://consultingblogs.emc.com/jamiethomson/archive/2005/11/03/SSIS_3A00_-Throwing-errors-from-script-task_2F00_component.aspx
Hope this helps!
Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com
I used a script task to check for my fail condition and used
Dts.Events.FireError to make the script task fail, which fails the sequence and fails the package. That is exactly what I wanted.
Some follow up questions. I have an OnError Event Handler on that script task and when that script task fails the msg I put in to FireError function comes out as the system variable ErrorDescription, which is great. Is there
a way to have a non failure message come out of the script task as well? So, say my fail condition isn't met, so I will continue to process. But before I continue on, I would like to write a message to my log saying "Moving On" using some kind of an Event
Handler. Would that be OnInformation? And if so, how do I raise this message from the script task and what system variable would have this message?
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2012 4:26pm
You can use an Execute SQL task to accomplish that.
For example, let's say a you have task and if it completes successfully, you'd like to log "Moving on" as the message in your log table. You can simply connect your task to an Execute SQL task(use Precedence constraint "Success")and
write an inset statement that writes to your log table. Hope this helps!Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com
July 6th, 2012 4:42pm
You can use an Execute SQL task to accomplish that.
For example, let's say a you have task and if it completes successfully, you'd like to log "Moving on" as the message in your log table. You can simply connect your task to an Execute SQL task(use Precedence constraint "Success")and
write an inset statement that writes to your log table. Hope this helps!
Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com
I know I can do it using Exec SQL Task. I need to do it using an Event Handler.
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2012 6:05pm