Solved

SSIS Package design question

Posted on 2011-09-05
1
204 Views
Last Modified: 2012-05-12
Hi,

Would you please let me know what woud you do if the followings are need to be implemented using SSIS 2008 BIDS:

1. Query a database table A
2. Loop through each A record, and query another database table B with part of A fields
3. Based on selected fields of B, set user variables accordingly.
    At the same time, loop through each B record, and query the third table C with part of A and B fields.
4. Concatenate a string with selected fields from Table A, B and C with the variables
5, Write the string to a flat file

please, if possible, illustrate the nodes that you would use. Thanks a lot.

I have tried to use 2 ways, but still not able to make them to work:

1. Data Control  with OLEDB Source for A table --> OLEDB Comand for B --> Script Component

with this way, OLEDB Command for B is not able to produce outputs. Therefore, I am not able to set variables in side script based on the selected B records.

2. Using Control flow -->Execute SQL Task for A --> Foreach Loop for resultset of A --> contains another Execute SQL Task for B --> still inside the foreach container, using Script Task

With this way, I can have outputs of precedent nodes however, I am not able to referent any resultsets in side the script.

Hope you understand what my problems are.

Thanks,
0
Comment
Question by:mystudent
1 Comment
 
LVL 2

Accepted Solution

by:
awarren85 earned 500 total points
ID: 36486377
Hi.

Pretty tricky.  Could this be done using pure SQL code and creating a view perhaps?  Maybe using some temp tables?  Probably a better knowledge of how tables A, B, and C work with each other would help.  Thanks.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

770 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