如何在 BIDS 中将变量传递给 ODBC SQL 命令? [英] How do I pass a variable to ODBC SQL Command in BIDS?

查看:35
本文介绍了如何在 BIDS 中将变量传递给 ODBC SQL 命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在 ODBC 源代码中的 SQL 命令中将该变量作为参数获取.

I'm trying to get the variable as a parameter in my SQL command in ODBC source.

我已经在表达式中创建了查询,但如何在 ODBC SQL 命令部分创建查询.

I've created the query in expression but how do I create the query in ODBC SQL Command Section.

推荐答案

ODBC 源 SqlCommand 可以用数据流级别的表达式设置:

The ODBC source SqlCommand can be set with an expression at the data flow level:

  1. 在数据流中,单击背景并按 F4 以查看数据流的属性.
  2. 在属性窗口中,滚动到表达式
  3. 点击...并选择要设置的属性,即[ODBC Source].[SqlCommand]
  4. 单击表达式列中的 ... 并添加如下表达式:

  1. In the data flow, click on the background and hit F4 for the properties of the data flow.
  2. In the properties window, scroll to expressions
  3. Click on the ... and choose the property to set, i.e. [ODBC Source].[SqlCommand]
  4. Click on the ... in the Expression column and add an expression like:

"SELECT * FROM MyTable WHERE id = " + @[User::MyVariable]

这篇关于如何在 BIDS 中将变量传递给 ODBC SQL 命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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