How do I pass a variable to use as the ODBC Source SQL Command for Teradata in SSIS?

Viewed 243

I need to build a SELECT statement during the execution of an SSIS package to be used as the SQL command in an SSIS ODBC Source activity for a Teradata source.

The SELECT statement is built correctly, and all I need to do is assign it as the SQL command for the ODBC Source activity. I'm not looking to pass a variable as an argument to a query but to provide the entire SQL Command from a variable value.

1 Answers

First of all, you should open the ODBC Source component editor and set the data access mode to SQL Command.

enter image description here

Next, you should select the Data FLow Task and press F4 to show the properties tab. Then, go to the expression property and open the expression editor dialog.

You will note that there is a property called ODBC Source.SQL Command that you can evaluate as an expression.

enter image description here

You can use the variable when evaluating this property as an expression.

enter image description here

Related