Solved

SSIS - SQL script

Posted on 2014-02-18
3
211 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
  • 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 500 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 500 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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.
Lessons learned during ten years of interviewing for SQL Server Integration Services (SSIS) and other Extract-Transform-Load (ETL) contract roles and two years of staff manager interviewing contractors.
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

762 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

18 Experts available now in Live!

Get 1:1 Help Now