Link to home
Start Free TrialLog in
Avatar of Rob Gaudet
Rob GaudetFlag for United States of America

asked on

Loop through records in SSIS and process based on data.

Within Sql Server Integration Services I need to loop through records, example set below, and check to find out if a particular value ('return') was passed.

Then if a match is found, I need to execute an update on a table.

I'm using an SSIS For each loop.

30.00 Completed
71.05 Completed
21.60 Returned
10.72 Completed

Open in new window

Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Show us some screen shots, especially the 'if a particular value ('return') was passed.
Guessing that you wouldn't need a loop to pull this off.
Rather than using for each loop container you can use the conditional split. When you find "Returned" send send it to other flow and use oledb command task to update the data.

Hope it will help you.
Avatar of Rob Gaudet

ASKER

Arif, I like the idea of using conditional split.

Still not the full answer though......

I need to update a table with the contents of each 'returned' record.
So the $30.00 and $21.60 must be inserted into another record, based on the key of course.

How do I accomplish this without a loop?

40B1F9D0-5F45-49B1-8A6A-DCCF04CAA3DE	30.00 Returned
A1DBC65A-11A1-4C98-BB36-8034201D260F	71.05 Completed
347FE271-7A20-4570-8A7E-56F8FBD1F56D	21.60 Returned
EF81B2AB-62FE-410A-84E8-B50BEB66EE22	10.72 Completed

Open in new window

You can insert the data with Returned in some staging table then you can use that staging table for further operation.
ASKER CERTIFIED SOLUTION
Avatar of Rob Gaudet
Rob Gaudet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I figured out for myself how to perform the update using an OLE DB PROCESS that calls an update stored procedure.