0

I'm looking for some help with getting started with the SSIS For Each Loop.

I have a process that calls an API based on an ID. It can only make one API call per ID. What I'm looking to do is query a set of IDs, have the ForEach Loop through each single ID, and have the data Upserted to a table.

Here's what I have now. The data flow task does exactly what I need it to do when I manually set the ID I want to pass to it.

Here's my control flow.

Here's my control flow

The "Get Employee IDs" Execute SQL Task is returning a resultset of IDs like below

ID
00001
00009
00015
00026

I'm going through the options and I'm confused to where to start. I'm guessing I need to have the Execute SQL Task set the variables, then pass them to the For Each Loop?

jdids
  • 561
  • 1
  • 7
  • 22
  • 1
    Read through https://stackoverflow.com/questions/13961534/how-do-i-pass-value-to-a-stored-procedure-parameter-in-ole-db-source-component/13976990#13976990 Does that clear it up - specifically Shred Recordset section? Create SSIS variable `CurrentId` as string. Use that as the parameter in the "Loop through IDs" and then use in your data flow for the web call. I assume the expression glyph on the Data Flow Task already has that piece established – billinkc Dec 01 '20 at 21:46
  • I think this leads me in the right direction. If you create a comment I can give you credit for the answer – jdids Dec 02 '20 at 19:50

0 Answers0