SSIS - 将值传递给参数的脚本 + 处理任务 [英] SSIS - Script + Process task to pass values to Parameters
本文介绍了SSIS - 将值传递给参数的脚本 + 处理任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 SSIS 包,它有一个要执行的进程任务,它在内部执行一个 *.bat 文件.
I have an SSIS Package that has a process task to be executed which internally executes a *.bat file.
*.bat 文件执行了几个步骤.我想将批处理文件中的一些值作为参数 %1、%2 等输入
The *.bat file has a few steps that are executed.I want to feed in some of the values in the batch file as parameters %1,%2 etc
我的结构如下:
-用户名 %1 -p%2
-username %1 -p%2
我想使用在流程任务之前存在的脚本任务动态地将值传递给此流程任务.
I want to pass values dynamically to this process task using a script task that would be present before the process task.
请告知如何实现这一点
推荐答案
Execute Process Task
有 Arguments
属性,可以通过 Expressions
动态设置代码>.
Execute Process Task
has Arguments
property, which can be set dynamically via Expressions
.
- 将参数值存储在变量中,例如
Param1
和Param2
- 选择
Execute Process Task
的Expressions
属性并创建新的表达式:Property
=Arguments
and表达式
类似于"-username" + @[User::Param1] + " -p" + @[User::Param2]
.如果参数不是字符串,您应该将它们转换为字符串.
- Store parameters values in variables, e.g.
Param1
andParam2
- Select
Expressions
property ofExecute Process Task
and create new expression:Property
=Arguments
andExpression
similar to"-username " + @[User::Param1] + " -p" + @[User::Param2]
. If params aren't strings you should cast them to strings.
这篇关于SSIS - 将值传递给参数的脚本 + 处理任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文