问题描述
我在表中存储了一行连接字符串。当我运行我的包时,它将调用并执行另一个包。进程任务将从表中提取连接字符串,然后将其作为变量存储,然后传递给子包。
I have a line of connection string stored in a table. When I run my package, it will call and execute another package. The process task will pull the connect string from the table then stored it as a variable then pass onto the child package.
Provider=SQLNCLI10;Server=153.191.61.44;Database=STAGE;Trusted_Connection=yet;
我在我的流程任务中使用的参数:
The argument I am using in my process task:
"/FILE \"" + @[User::entityStagePackage] + "\"
/SET \\Package.Variables[User::controlCount].Properties[Value];\"" + (DT_WSTR,10) @[User::controlCount] + "\" /SET \\Package.Variables[User::fileID].Properties[Value];\"" + (DT_WSTR,10) @[User::fileID] + "\"
/SET \\Package.Variables[User::filePathName].Properties[Value];\"" + @[User::filePathName] + "\"" + "
/SET \\Package.Variables[User::archivePath].Properties[Value];\"" + @[User::entityArchivePath] + "\""
+ "
/SET \\Package.Variables[User::stageID].Properties[Value];\"" + (DT_WSTR,10)@[User::stageID] + "\""
+ "
/SET \\Package.Variables[User::MasterExceptionPkg].Properties[Value];\"" + (DT_WSTR,100)@[User::MasterExceptionPkg] + "\"" + (DT_WSTR,500) @[User::iniVariable]
执行包时,由于变量@ [User :: iniVariable],我收到错误消息:
When executing the package, I got error message because of variable @[User::iniVariable]:
/Conn OH_STAGE;Provider=SQLNCLI10;Server=153.191.61.44;Database=STAGE;Trusted_Connection=yes;" at "", The process exit code was "6" while the expected was "0".
如果从我的论证中拿出(DT_WSTR,500)@ [User :: iniVariable],包运行成功。任何人都可以指出我的连接字符串变量有什么问题。
评估表达式如下所示:
If I take (DT_WSTR,500) @[User::iniVariable] out from my argument, the package run successfully. Can anyone please point out what's wrong with my connection string variable.
Evaluate Expression look like below:
/FILE "" /SET \Package.Variables[User::controlCount].Properties[Value];"0" /SET \Package.Variables[User::fileID].Properties[Value];"23" /SET \Package.Variables[User::filePathName].Properties[Value];"" /SET \Package.Variables[User::archivePath].Properties[Value];"" /SET \Package.Variables[User::stageID].Properties[Value];"26" /SET \Package.Variables[User::MasterExceptionPkg].Properties[Value];""
/Conn metaDBl; "Provider=SQLNCLI10; Server=153.191.61.44; Database=STAGE; Trusted_Connection=yes;"
谢谢!
Thank you!
推荐答案
这篇关于SSIS,如何将连接字符串变量从主包传递到子包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!