Solved

SSIS: Using variable in OLE DB SQL command text

Posted on 2011-02-15
3
1,036 Views
Last Modified: 2013-11-10
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
Comment
Question by:wppiexperts
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
EvilPostIt earned 125 total points
ID: 34897743
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
 

Author Comment

by:wppiexperts
ID: 34897781
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
 
LVL 16

Expert Comment

by:EvilPostIt
ID: 34897799
Yes you reference it using the source component after selecting the "SQL Command from variable" drop down.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now