As I mentioned in my previous post, I did a short presentation on using loop containers in SSIS.

I promised a few people that I'd publish my code, so here it is.

For those that didn't make it, the package demonstrates a basic ForEach Loop container. I decided to demonstrate something that was absolute hell to accomplish in DTS.

Back in the SQL 2000 world, if you wanted to send an automated email to customers, the basic procedure was to write a nasty ActiveX script that would hit the database, loop through the results, create and send an email, then update the database.

In SSIS this is easily accomplished with a ForEach Loop. I show this in the sample from my demo that executes some SQL using an Execute SQL Task to produce a Result Set and looping through the rows with a ForEach loop container to send an email before updating the current row with another SQL Task. I created the package (almost) from scratch within 10 minutes in my demo on Saturday.

I've tacked in a change, which enables a package configuration to demonstrate how you would configure the package in a more practical environment. Please check out the Readme to get an idea of what you need to do to get the package working.

If you have any issues with the package, leave a comment or use my Contact Me form to send me an email.