SSIS has the ability to force a task execution result. With
the help of ForceExecutionResult property, we can set the task executing
result.
By default
the ForceExecutionResult value is none. It means this value assign during the
execution.
We can set
the execution result forcefully by setting this property.
Let’s see the demo
Here I am taking a sequence container and in this container
I am taking two execute sql task.
First execute sql task
In this task I have written an error sql script divide by
zero.
2nd execute sql task
In this I have written correct sql query.
Running package with default property.
Running now
See the execution result
Now I am setting the ForceExecutionResult success for the
execute sql task
Now running this package.
It’s completed successfully even though it has error.
When we connected both execute sql task with precedence
constrain then we need to set the ForceExecutionResult property of execute sql
task to “Success”.
Running with default value
In this case my 2nd execute sql task does not
executed.
Now setting the value of execute sql task to
ForceExecutionResult =”Success” then even execute sql task failed my 2nd
execute sql task will execute.
Running this package.
Even the 1st execute sql task having error but
here we are setting the forcefully result success.
When we set the ForceExecutionResult value is failure then
even our correct task will fail.
See the 2nd execute sql task.
Running this package
Getting failed.
See the execution result.
Hope this will help to understand use of
ForceExecutionResult property in SSIS package.