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).

enter image description here

I have a variable in the DFT scope.

enter image description here

I am assigning a value to a variable using Transaformation Row Count.

enter image description here

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.

enter image description here

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.

enter image description here

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?

+2


source to share


2 answers


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.

+4


source


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!



0


source







All Articles