I have a package with 1 container.Does the ssis pacakge fail,If that container fail!?
The property
FAIL PACKAGE ON FAILURE
is false for the container.
Does that mean the package fail only if this property set to TRUE,other wise only the container status is failed ,and the package status is not !?
Yes. If the Sequence Container fails, the overall package will fail. Raise the MaximiumAllowedErrors property of the Sequence Container to get the behavior you want.
Example
Below we have an example package. The Sequence Container has a task that will never succeed.
Above, the Sequence Container has failed and the Package has failed. Below are the properties of the container above. These are the default values for a new container.
Now lets stop and study. If we compare the package behavior against the property settings, this looks wrong. Here we have set FailPackageOnFailure=False, yet a Sequence Container failure is causing a Package failure. Why is this? Unintuitive attribute names. See this Microsoft Connect issue. You are not alone in your confusion. The official explanation from Microsoft is this.
Despite some pretty circular previous messages, we believe that the
feature is behaving as designed. When you set FailParentOnFailure to
false, the parent will not fail until the number of failures in the
child exceeds the MaximumAllowedErrors threshold. When you set
FailparentOnFailure to true, the parent will fail on the first
occurence of an error regardless of the MaximiumAllowedErrors
threshold.
The important piece of information to take away from that quote is that the FailPackageOnFailure and MaximiumAllowedErrors work as a pair!!!
So - knowing this - we can achieve the expected behavior by raising the MaximiumAllowedErrors count from 1 to 2.
This will allow you to have a sequence container which fails, but does NOT fail the overall package.
Hope this helps!
It all depends on how the package and containers is set up. You have to open/import it (in SQL Server Business Intelligence Development Studio) and run on preferable test data to see which one fails. Do the two containers have inter-dependencies on each other?
Related
I am working with Captiva Designer and implemented a flow. In the ODBC setup, I have checked the checkbox which says "Error if more than one row found".
I tested the flow and intentionally used a query which would return multiple rows. However the flow picks up the first query and process next steps accordingly.
How can I fix this issue?
For marking it as error, it will not mean to give any batch level error. However it will mention "More than one row found for fetch", in description attribute, in export module at document level.
you can handle the case accordingly in your flow using the above value.
I have a SSIS package with lots of containers and logic. I am running an additional task (which I want to run independently) let's say it acts as an Event Listener. When this separate task is errored, I want to error out the entire package. I thought, it should work by default but to my surprise, it's not:-
I have tried setting both FailPackageOnFailure & FailParentOnFailure properties on both the parent container & the child container but it's not working.
I was about to ask exactly the content of your last comment.
Failure of one piece of a package won't make another, unconnected piece stop executing. Once the executing piece is done, the package will fail, but Sequence Container 3 has no way to know what's happening in Sequence Container 2.
Which, honestly, is what we want. If Sequence Container 3 is doing DML, you could leave your data in an unfortunate state if an unrelated failure elsewhere in the package suddenly made everything come to a screeching halt.
If you don't want Sequence Container 3 to run if Sequence Container 2 fails, then just run a precedence constraint from Sequence Container 2 to Sequence Container 3, #3 won't execute until #2 succeeds and the Execute SQL Task succeeds.
I completely agree with Eric's answer. Let me explain to you why raising a flag on error won't work.
I redesign the package so it includes the flag check.
Let's say we have a success flag as user variable which is by default False.
Now we set this variable as True at the end of sequence 2 execution marking the success of all the other tasks in that sequence.
The second part is put into a for loop which runs only once(if at all). It checks if the success variable is true and only then run the inner tasks. It looks like below:
The problem is, the success variable check at the start of the for loop will always have the inital value which is false(because it runs in parallel with seq 2 and doesn't wait till seq 2 ends). Hence the second part is never executed. Now change the initial value of success variable to true and run the package again. Play by disabling the error prone tasks and run the package. You will understand how it works.
It seems SSIS has some unexposed variables called execution_result in the SSISDB/ Catalog under internal.executable_statistics.
But it's also referred to as DataCode in some places but it's essentially for each executable (so task or package level, etc).
0 = success, 1 = failure, 2 = complete, 3 = canceled.
I'm rolling some custom logging just as a simplified/ understandable view of my ETL tasks in SSIS to use in tandem with the more 'kitchen sink' logging in the SSIS Catalog 'internal' schema in SQL Server.
There are no system variables that seem to mimim/ capture ExecutionResult for any particular executable. Is there any way I can capture this and write it to a table or save it in a variable?
I've seen some try to use it in a Script Task that had to reference .dtsx filepath etc --- seems pretty complicated but anyone know an elegant way?
Essentially, I want a logging level (custom written) that is essentially: Package XYZ, blah, blah, blah, blah, executionResult: 1
Again I'm aware this is in executable_statistics, but not how I like it, and I only have SQL Sever 2012 currently so can't customize too much either.
Essentially I want to know if a package ultimately "succeeded" or "failed". Errors are on the right track, but not the same. Since it's possible a package (or container) can have an error and still succeed ultimately.
I suppose I could jerry-rig two separate Execute SQL tasks depending on if a package/ container "succeeded" or "failed" and go from there. Hmm.
ExecutionResult is available when using Event Handlers (on OnExecStatusChanged event handler):
System Variables for Event Handlers
So, on each task you can add an OnExecStatusChanged event handler and the #[System::ExecutionResult] variable will be available.
If you are new to Event handlers you can refer to the following articles:
SSIS Event Handlers Basics
Event Handlers in SSIS
Integration Services (SSIS) Event Handlers
Update 1
You can also benefit from the ExecValueVariable property of each task:
ExecutionValue and ExecValueVariable in SSIS
Have you used the ExecutionValue and ExecValueVariable properties?
I have a package that has a loop in it, that loops through a few connections. Each iteration through the loop is a new connection. The problem is though that sometimes these connections are down at package run time. So I've added an on error, send us an email notification, and then continue with the loop.
This works fine, using the Event Handlers and changing the Propagate value to False. But the issue is, if a connection fails, it will finish the loop, but report the entire package fails. This is an issue because inside a job in SSMS, it will stop the job after that package is complete, and report it failed, when it really did not.
Is there a way to have the package report success even if this loop kicks out the failed e-mail? I don't want it "Continue to next step on fail" because there are other parts to that package that could legit fail, and need to be notified on.
EDIT:
Here are screen shots of what I'm doing. Inside the loop there is a dataflow task, the first dataflow has the connection that sometimes fails. When it does, it triggers the email task to notify us, then will continue with the loop.
Unfortunately the FailPackageOnFailure is already set to false.
On the task that fails (or its parent container if applicable), change the value of FailPackageOnFailure to false.
If you are doing this to a task in a loop, you may want to consider whether you also need to set FailParentOnFailure to false as well.
EDIT: If none of your tasks or containers are causing the package to fail with FailPackageOnFailure=true, then probably you are setting the package to fail in a script. Maybe in your event handlers you are keeping a count of errors, and then at the end of the package you are setting the package state to failure if the error count <> 0.
Examine all the points at which you could be setting the package to fail, either through a script or through the FailPackageOnFailure property.
You can fake the execution result to success by setting the property ForceExecutionResult to Success (Default value of this property is None) for the Foreach Loop Container.
An ActiveX Script in a DTS package can return DTSTaskExecResult_Success or DTSTaskExecResult_Failure. Is there a way to indicate that it is not a success without failing the entire package? We'd like it to keep going, but in a different direction. The options for a path are Success, Failure, and Completion, but it appears the only return values for the ActiveX Script are Failure and Success. 'DTSTaskExecResult_Completion' isn't right. What is?
(The solution we're probably going to pursue is modifying this to SSIS, but I wanted to know if it was possible in DTS.)
Try setting the DTSTaskExecResult_Retry return value; it tells you that it failed, but doesn't failout completely?
Edit: sorry it is : DTSTaskExecResult_RetryStep
FYI: ActiveScriptTask objects have full access to the GlobalVariables collection, which provides a way to share information across tasks.
As far as I know, when using the ActiveX DTS Component, your options are limited to Success/Failure. :(
-Shaun
Yes, the options are limited to Success/Failure.
You can also use RetryStep option, but to do what? This option just repeat the step and the DTS never end.
The option that I use, is to use Success result, always.
But previously to set the result, I do my checking, and if I don't want to execute the next step, just set the task (the next task) as Completed.
By this way, the next task is not executed and you succeed in your purpose.
Sample:
Set oPackage = DTSGlobalVariables.Parent
If HasRows = 0 Then
oPackage.Steps("DTSStep_DTSExecuteSQLTask_1").ExecutionStatus = DTSStepExecStat_Completed
End If
Main = DTSTaskExecResult_Success
Hope this can help to anyone.
Regards,