我可以使用表达式在"SQL语句任务"中设置变量吗? [英] Can I use an Expression to set a variable in a "SQL Statement Task"?

查看:228
本文介绍了我可以使用表达式在"SQL语句任务"中设置变量吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用表达式在"SQL语句任务"中设置变量吗?
我设计了一个ETL解决方案,可从网站加载纯文本文件.用户输入主要参数,如月,年,注册计数,然后按处理按钮. ETL解决方案开始.

Can I use an Expression to set a variable in a "SQL Statement Task" ?
I am designed an ETL solution loading a plain text file from a website. The user write the main parameters, like month, year, registercount, and press the processing button. The ETL solution starts.

直到现在,我仍习惯于使用同一"SQL语句任务"中的SQL语句读取/设置变量,但是当从Web应用程序使用具有用于设置这些变量的相同参数的解决方案启动解决方案时,有时它们无法正常工作.我没有问题可以读取表达式中的变量,但是我无法编写它们.

Until now, I am used to read/set variables with SQL statements inside same "SQL Statement Task" but sometimes they do not work properly when the solution is started from the web app with these same params used to set these variables. I have no problem to read variables in an expression but I am not able to write them.

推荐答案

如果您正在谈论执行SQL任务",则可以使用表达式.在这里,我通常要做的是将类型配置为直接输入",然后将整个语句(包括我的参数化值)定义为表达式.如果右键单击任务,则可以选择属性,然后在属性中单击表达式"左侧的"+",然后单击显示在其右侧的"...",以打开表达式弹出窗口.然后,选择属性"SqlStatementSource"后,可以再次单击右侧的"...",然后在此处输入表达式.

If you are talking about the "Execute SQL Task", expressions are possible. Here what I usually do is to configure the type as "direct input" and then define the whole statement - including my parametrized values - as expression. If you rightclick the task, you can select properties and in the properties you open the expression popup by clicking the "+" left of "Expressions" and then "..." which appears right of it. Then after selecting the property "SqlStatementSource" you can click the "..." at the right again and enter your expression here.

这篇关于我可以使用表达式在"SQL语句任务"中设置变量吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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