• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1068
  • Last Modified:

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.

0
wppiexperts
Asked:
wppiexperts
  • 2
1 Solution
 
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now