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

SSIS - SQL script

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
LuckyLucks
Asked:
LuckyLucks
  • 2
2 Solutions
 
David ToddSenior DBACommented:
Hi,

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

Regards
  David
0
 
ValentinoVBI ConsultantCommented:
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
 
ValentinoVBI ConsultantCommented:
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
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

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