How do I pass a variable to ODBC SQL Command in BIDS?

自闭症网瘾萝莉.ら 提交于 2019-12-24 10:47:19

问题


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

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


回答1:


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

  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]
    


来源:https://stackoverflow.com/questions/42927356/how-do-i-pass-a-variable-to-odbc-sql-command-in-bids

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!