How works the Property ForceExecutionValue
Hi there,
In the Control Flow you can force the Executionvalue of a Task.
There is the properties ForceExecutionValue, that you must activate, and the property ForcedExecutionValue
for the value which should be the ExecutionValue. In the property ForceExecutionValueType you define the
Datatype of the Execution Value.
So far so good, but in which way can I use this forced Execution Value?
For Example:
- an Execute SQL Task executes an UPDATE-Statement that updated 3 records
- in the property ExecValueVariable is the variable "varValue"
- after that Execute SQL Task, there is a Scripttask with a messagebox, that shows the value of the variable "varValue"
If I run the package, everything works fine. 3 records were updated and the messagebox shows the value 3.
Now I change the property ForceExecutionValue to True, and the property ForcedExecutionValue to 1.
If I run the package, I expect a messagebox with the value 1. But I shows still the value 3.
What am I doing wrong?
thx, Bernd
July 23rd, 2010 12:00pm
You aren't doing anything wrong, but you are mixing your apples and your oranges.
The ExecValueVariable captures the output of what the query in that task perfomed, rows updated. Aswell as this, a task will return a value as to its success or failure and the ForceExecutionValue property is relevant to the success/failure of the task itself,
not information about what the task did. These are not mutually exclusive and provide information on different things.
http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.dtscontainer.forceexecutionresult.aspxevery day is a school day
Free Windows Admin Tool Kit Click here and download it now
July 26th, 2010 12:30pm
Hi,
thx for you help. But now I'm confused.
First off all your link leads to the description of the property ForceExecutionResult.
With these property I can force the ExecutionResult of a task. That's ok.
But my Question belongs to the property ForceExecutionValue.
A look into the BOL shows me following explanations:
---
DtsContainer.ForceExecutionValue Property
Gets or sets a Boolean that indicates whether the execution value of the container should be forced to contain a particular value.
DtsContainer.ForcedExecutionValue Property
If the ForceExecutionValue property is set to true, gets or sets a value that specifies the optional execution value that the package returns.
DtsContainer.ForceExecutionResult Property
Gets or sets a DTSForcedExecResult enumeration value that specifies the forced execution result of the container.
---
What kind of Value can I change with the property ForceExecutionValue?
The ExecutionValue of the Task or the ExecutionResult?
thx,
Bernd
August 4th, 2010 10:59am
Hi,
thx for you help. But now I'm confused.
First off all your link leads to the description of the property ForceExecutionResult.
With these property I can force the ExecutionResult of a task. That's ok.
But my Question belongs to the property ForceExecutionValue.
A look into the BOL shows me following explanations:
---
DtsContainer.ForceExecutionValue Property
Gets or sets a Boolean that indicates whether the execution value of the container should be forced to contain a particular value.
DtsContainer.ForcedExecutionValue Property
If the ForceExecutionValue property is set to true, gets or sets a value that specifies the optional execution value that the package returns.
DtsContainer.ForceExecutionResult Property
Gets or sets a DTSForcedExecResult enumeration value that specifies the forced execution result of the container.
---
What kind of Value can I change with the property ForceExecutionValue?
The ExecutionValue of the Task or the ExecutionResult?
thx,
Bernd
Does anyone have an answer?
Free Windows Admin Tool Kit Click here and download it now
August 27th, 2010 11:38am
Hi,
thx for you help. But now I'm confused.
First off all your link leads to the description of the property ForceExecutionResult.
With these property I can force the ExecutionResult of a task. That's ok.
But my Question belongs to the property ForceExecutionValue.
A look into the BOL shows me following explanations:
---
DtsContainer.ForceExecutionValue Property
Gets or sets a Boolean that indicates whether the execution value of the container should be forced to contain a particular value.
DtsContainer.ForcedExecutionValue Property
If the ForceExecutionValue property is set to true, gets or sets a value that specifies the optional execution value that the package returns.
DtsContainer.ForceExecutionResult
Property
Gets or sets a DTSForcedExecResult enumeration value that specifies the forced execution result of the container.
---
What kind of Value can I change with the property ForceExecutionValue?
The ExecutionValue of the Task or the ExecutionResult?
thx,
Bernd
Does anyone have an answer?
ForcedExecutionValue property needs to be set if you want to have a forced value.
Next ForceExecutionResult propety holds the return value of task which can identify whether it is success or failure. Like a return code 0 when success or return code 1 in case of failure. So this property will only ensure whether
your task will be a success or failure and you can forcefully make it success or failure according to your own will-ankur
August 27th, 2010 11:48am
Hi ankur,
thx for your response.
Now I have tested the ForceExecutionResult with 1 and 0. But it didn't work.
For example: there is a workflow with 1 Execute SQL Task and 2 Skripttasks.
The Execute SQL Task executes an SQL-Statement and the result is successfully.
From the Execute SQL Task goes one precedence constraint with status success to the first skripttask and another one with status failure to the second skripttask.
If I run the package, it always run the Execute SQL Task and the first skripttask.
It doesn't matter, if the ForcedExecutionValue is 1 or 0.
Another Question:
It the only possible values in the Property ForcedExecutionValue are 1 and 0, why can I select any kind of datatype in the Property ForcedExecutionValueType for the Property ForcedExecutionValue?
thx,
Bernd
Free Windows Admin Tool Kit Click here and download it now
August 27th, 2010 1:00pm
Bernd,
Did you get it?-ankur
August 27th, 2010 1:00pm
Because it is a response code of task which is passed to another task stating that I am done with a success (1) now you can start. If I am 0 then handle would be passed to onError and not to next task.
This is a feature provided to developer for special cases where he wants to force success or failure of its task.-ankur
Free Windows Admin Tool Kit Click here and download it now
August 27th, 2010 1:14pm
Because it is a response code of task which is passed to another task stating that I am done with a success (1) now you can start. If I am 0 then handle would be passed to onError and not to next task.
This is a feature provided to developer for special cases where he wants to force success or failure of its task.
-ankur
So it only can used by custom task? And not in the control flow?
And why can I select different datatypes for this forcedexecutionvalue?
August 27th, 2010 1:21pm
Because it is a response code of task which is passed to another task stating that I am done with a success (1) now you can start. If I am 0 then handle would be passed to onError and not to next task.
This is a feature provided to developer for special cases where he wants to force success or failure of its task.
-ankur
So, these properties can not be used in the controlflow? Is that correct?
Free Windows Admin Tool Kit Click here and download it now
September 30th, 2010 2:09pm
IMHO, the key here is the relationship between ForcedExecutionResult and ForceExecutionValue.
any idea?
Andrew
BI, Data Mining, Analytical CRM
January 5th, 2011 3:48am


