title: SSIS ForEach Loop with count
body: <p>I'm looking to create a ForEach Loop in SSIS:</p>
  
  <p>Essentially, I have a set of data with ID numbers that must be unique. When I assign the IDs, I have a check that will make sure these IDs don't already exist in a members table. I am using a count(*) of every record that has a match to determine this. If the count is >0, the records in the initial table are removed and re-inserted to assign it a new ID. </p>
  
  <p>What I'd like to do is setup a loop to continue this process until that initial count is 0 (in case re-adding the record gives it an ID that is <em>also</em> existing in the members table.</p>
  
  <p>I believe a ForEach Loop with Variable enumerator is the way to go here, but I'm not quite sure how to set this up using a count.</p>