在 SSIS 中执行 DFT 期间,行计数转换设置的变量值是否生效?或条件拆分可以正确读取变量吗? [英] Does variable value set by Row Count Transformation take effect during execution of DFT in SSIS? or Conditional Split can read a variable correctly?

查看:34
本文介绍了在 SSIS 中执行 DFT 期间,行计数转换设置的变量值是否生效?或条件拆分可以正确读取变量吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 SSIS 包,其中 1 个记录(硬编码)流过.

I have a SSIS package where1 record (hard coded) flow through.

我在 DFT 范围内有变量.

I have variable in DFT scope.

我使用行计数转换为变量赋值.

I assign value to variable using Row Count Transaformation.

值应该是 1 我通过使用脚本组件验证它.

The value should be 1 i verify it by using 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 look for zero condition through condition in Conditional split transformation.

奇怪的是它满足等于零的条件,而我认为它的值应该是 1.即使 Messagebox 通过脚本组件也显示值 1.

Strangely it satisfies equal to zero condition whrease I think it should have value 1. Even Messagebox through script component shows value 1.

可能是什么原因?变量中的值是仅在 DFT 结束时才实现还是条件拆分在读取正确值或其他一些我无法想出的问题时有问题?

what could be the reason? Are value in varible realize only towards end of DFT or Conditional Split has some problem reading correct value or something else which i am not able to think up?

推荐答案

数据流任务中分配的variable的值不能在<数据流任务中的代码>拆分转换或更高版本.一旦 DFT 获得 completed ,这些值通常会populated.

The value for variable being assigned inside a data flow task can't be used in the split transformation or later in the Data Flow task . The values generally get populated once DFT gets completed .

Variable values does not update during the execution of Data Flow task 

即使您能够从执行后或执行前事件中的脚本转换中看到 value 1 或将一些其他值设置为 Variable,但这些值仅在DFT

Even though you are able to see value 1 or set some other value to Variable from script transformation in post or pre execution events ,these values gets effected only after the execution of DFT

因此更新后的值可用于控制流中的优先约束或其他任务.

Hence the updated value can be used in precedence constraint or other tasks in control flow .

阅读这篇文章 .

这篇关于在 SSIS 中执行 DFT 期间,行计数转换设置的变量值是否生效?或条件拆分可以正确读取变量吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆