?
Solved

SSIS - SQL script

Posted on 2014-02-18
3
Medium Priority
?
233 Views
Last Modified: 2016-02-10
Hi

 Can I run a SQL involving multiple tables in SSIS? So far I can seem to pull data from a single table using Data flow?
0
Comment
Question by:LuckyLucks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

Expert Comment

by:David Todd
ID: 39869515
Hi,

Maybe this is too obvious, but create a view, and use that as a data source.

Regards
  David
0
 
LVL 37

Assisted Solution

by:ValentinoV
ValentinoV earned 2000 total points
ID: 39869761
It's supported, even without a view.  If you open the properties of the OLE DB Source, you'll see a dropdown called Data access mode.  The default is Table or view but this is not a recommended practice (it's the equivalent of SELECT *).  Change it to SQL command and you'll be able to enter any SELECT statement there, including one with joins to other tables.
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 2000 total points
ID: 39869764
BTW: whenever I need a complex query as source I usually put it in a stored procedure.  The reason for this is because these types of query are prone to changes and when you're dealing with a production environment on which you don't have any write access, you want to minimize the change impact.  In this case you wouldn't need to modify the SSIS package when the source query logic changes, as long as the output fields remain the same of course.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

777 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