问题
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:
- In the data flow, click on the background and hit F4 for the properties of the data flow.
- In the properties window, scroll to expressions
- Click on the ... and choose the property to set, i.e.
[ODBC Source].[SqlCommand]
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