【问题标题】:Is it possible to change a package from a script task that exists in the same package?是否可以从同一包中存在的脚本任务更改包?
【发布时间】:2011-08-02 13:10:25
【问题描述】:

在 SSIS 中...是否可以通过其脚本任务之一访问和更改包本身?如果是……你能举个例子吗?

例如,我想通过位于循环外部(之前)的脚本任务以编程方式配置 foreach 循环中的任务。例如读取文件并根据其内容添加/删除/配置任务。

感谢您的宝贵时间!

【问题讨论】:

    标签: ssis


    【解决方案1】:

    正如@Derek 已经提到的,无法更改包本身。但是,您可以使用优先约束/表达式来根据变量中存在的值更改控制流任务的行为,如果这就是您更改包的意思。

    以下是我使用优先约束基于表达式重定向/限制控制流任务的几个示例:

    How to loop through only files that don't exist in destination using an SSIS package?

    How can I stop a package execution based on a stored procedure output?

    How to avoid SSIS FTP task from failing when there are no files to download?(This example uses a script task followed by a Foreach Loop container.)

    How to write an SQL statement output to a CSV file?

    希望对您有所帮助。

    【讨论】:

      【解决方案2】:

      不,这是不可能的 - 但是,我通过使用我多次重复使用的第二个“子”包来做一些非常相似的事情。在脚本中你可以简单的清除子包,把你需要的所有item/containers/constraints放进去,然后执行。

      【讨论】:

      • 谢谢,这就是我正在采取的方法。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-11-07
      • 1970-01-01
      • 1970-01-01
      • 2011-08-26
      • 2011-05-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多