SSIS: Using variable in OLE DB SQL command text

Is there a way to reference a variable as part of the SQL command text in the OLE DB source editor?

For example if I have a variable defined as myVar::
SELECT myVar, Account, CustName from Customers

resulting in output of:
RESIDENTIAL, 100, Steve
RESIDENTIAL, 200, Jim
etc.

wppiexpertsAsked:
Who is Participating?
 
EvilPostItCommented:
In the data access mode drop down box you can choose the "SQL Command from variable" and then choose the variable you want to use.
0
 
wppiexpertsAuthor Commented:
so the only way to incorporate a variable like that is to build a variable containing the SQL string, there is now way to reference it via @User:: or anything like that?
0
 
EvilPostItCommented:
Yes you reference it using the source component after selecting the "SQL Command from variable" drop down.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.