1

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.

Sunil Garg
  • 14,608
  • 25
  • 132
  • 189
user2919579
  • 39
  • 2
  • 10

1 Answers1

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]
    
Mark Wojciechowicz
  • 4,287
  • 1
  • 17
  • 25