Does the value of the variable set by the row count conversion affect the DFT runtime in SSIS? or the conditional separator can read the variable correctly?
I have an SSIS package that is being written to (hardcoded).
I have a variable in the DFT scope.
I am assigning a value to a variable using Transaformation Row Count.
The value should be 1, I check it with a script component.
public override void PostExecute()
{
System.Windows.Forms.MessageBox.Show(ReadWriteVariables[0].Value.ToString());
base.PostExecute();
/*
Add your code here for postprocessing or remove if not needed
You can set read/write variables here, for example:
Variables.MyIntVar = 100
*/
}
I was looking for a null condition through a condition in a conditional difference transform.
Strangely it satisfies the null condition of absence I think it should have the value 1. Even the Messagebox through the script component shows the value 1.
what could be the reason? Are there values ββin varible only at the end of DFT or Conditional Split, is there some problem reading the correct value or something else I can't think of?
source to share
An variable
internally assigned value data flow task
cannot be used in split transformation
or later in a data flow task. Values ββare usually obtained populated
after the DFT receives completed
.
Variable values does not update during the execution of Data Flow task
Even if you can see value 1
or set a different value in variable
from the conversion script in post or pre-execute messages, these values ββwill only be executed after executionDFT
Therefore, the updated value can be used for priority limiting or other tasks in the control flow.
Read this article.
source to share
Alternatively, you can use the RANK function as one of the columns, the latter uses conditional splitting with the max function to get the number of rows selected (in direct row count). Then you can use the Copy column and delete the RANK column before pasting to the final destination. Hope this helps!
source to share