Loop through ADO recordset in SSIS

For some solutions in SSIS you may need to go over all records from some SELECT and each record use in some subqueries. In this case you want loop record per record in some task series. Best solution is to use Looping through recordset. Because of SSIS is intuitive enough to create this task, here is step by step overview. In this step by step tutorial, I am using AdventureWorks database from Microsoft. This database was created for testing purpose and is ideal for our example.




In previous content I showed how to use the OUTPUT command for printing inserted or updated records in a T-SQL query. It's simple, it's powerfull and saves us lines of code. Usually we need use these values in some larger script and assigned them to variables or insert them into other tables. Let's see how to do it.
Here is simple online convertor from CSV to SQL. You just insert CSV data to text area and table name. Script will generate SQL insert query for all records from CSV.