简体   繁体   English

SSIS中的数据流任务中的变量

[英]Variable in Data flow task in SSIS

I have developed SSIS package where in I have script component and Data flow task. 我开发了SSIS包,其中包含脚本组件和数据流任务。 Script component take 2 input variables namely Db2Con, SQLCon which are DB2 connection string and SQL Connection String. 脚本组件采用2个输入变量,即Db2Con,SQLCon,它们是DB2连接字符串和SQL连接字符串。 In this script component, I am dynamically generating Query and saving its value to the output variable namely DB2Qry. 在此脚本组件中,我将动态生成Query并将其值保存到输出变量DB2Qry。 Now, In Data flow task, I am using this variable for source component.But it is not allowing me to do so with an Error "SSIS Error Code DTS_E_OLEDBERROR". 现在,在“数据流”任务中,我将此变量用作源组件。但不允许这样做,并出现错误“ SSIS错误代码DTS_E_OLEDBERROR”。 In script component, I have made this variable as 'ReadWrite Variable.' 在脚本组件中,我将此变量设置为“ ReadWrite变量”。 Please suggest if I am missing something. 请建议我是否缺少什么。

SQL's EvaluateAsExpression should be set to FALSE. SQL的EvaluateAsExpression应该设置为FALSE。 You're not putting an expression into the variable, As you're assigning a static value through your script. 您没有在变量中添加表达式,而是通过脚本分配静态值。

and you need to manually set a "default" value for your SQL variable in the Variables pane, otherwise the OLE DB Source has nothing to use for the SQL statement at design time 并且您需要在“变量”窗格中为您的SQL变量手动设置一个“默认”值,否则在设计时OLE DB Source不能用于SQL语句

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM