September 21, 2008 at 6:34 pm
I have a scenario where a parent package calls a number of child packages.
Some of the child packages have a File System Task that is used to delete a folder. When the package is run, the folder may not exist. If the folder does not exist, I dont care of course. However the task throws an error.
So I can ignore that error by:
1. Set ForceExecutionResult=Success and also
2. Create an OnError event handler and set its System :: Propagate=false
This works fine when child package is executed independently. It will succeed even when the folder does not exist.
However when the child is called from a parent, the parent fails.
This behaviour is described in MSDN post: http://msdn.microsoft.com/en-us/library/ms141788(SQL.90).aspx which states that the System::propagate variable does not prevent events going to a parent package.
The same post states that to prevent the parent package getting the error:
set the DisableEventHandlers property of the Execute Package task to True
.
However:
1. I want to handle this error selectively. I want the parent to fail other errors, just not this one
2. I tried setting DisableEventHandlers to true on the execute package task and it did not work for me. - the parent still failed.
Help: does anyone have any answers??
September 22, 2008 at 7:35 am
Hi Renato,
My suggestions are more architectural than anything as I don't know how you can proceed with package execution in the parent based on selective errors in the child (If you do find a way I'd love to know how). And I'm not even sure if you'd want to...
Firstly and probably the best fix would be to check for the existence of the folder before attempting to delete it, there by preventing the error in the first place. In my view this isn't really an error, if you've already decided that you can proceed anyways.
Secondly, you could look at the possibility of splitting up your package so that the file task takes place exclusively in one generic child package, and the rest of the logic takes place in another. You could then suppress errors from the file system package execution (in the parent package), but not in the dataflow package execution.
Good luck
Kindest Regards,
Frank Bazan
September 22, 2008 at 3:02 pm
Frank,
Thanks very much. Both of these sound like workable solutions.
I think I will go with a Script task that tests for existence of the folder as you suggested. While in there the script may as well also do the delete, rather than muck around with another File System task and the variables required to communicate between the two.
I guess that means SSIS does not really have decent error handling. I am thankful for the good old Script task.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply