![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Very long story short, I have a group of steps in an SSIS package that I would like to loop through based on the values returned from an SQL SELECT statement. I've tried to set up the ForEach Loop container to process the statement, but have been unsuccessful. How do I tell the container to iteratively process the key values returned by the SELECT? |
#3
| |||
| |||
|
|
Hello Mike, So you have a SELECT statement that returns a rowset. You want to loop over the rowset and execute n Tasks? Read the SELECT statement into a Rowset variable (object) Now in the ForEach loop use the ForEach ADO Enumerator type and add your variable when prompted. Is this what you want to do ? Allan Very long story short, I have a group of steps in an SSIS package that I would like to loop through based on the values returned from an SQL SELECT statement. I've tried to set up the ForEach Loop container to process the statement, but have been unsuccessful. How do I tell the container to iteratively process the key values returned by the SELECT? |
#4
| |||
| |||
|
|
Read the SELECT statement into a Rowset variable (object) GREAT! How do I do that? Do I need a separate Data Flow to make that happen? |
|
Allan: That should do it. Thanks for the assist. mc "Allan Mitchell" wrote: Hello Mike, So you have a SELECT statement that returns a rowset. You want to loop over the rowset and execute n Tasks? Read the SELECT statement into a Rowset variable (object) Now in the ForEach loop use the ForEach ADO Enumerator type and add your variable when prompted. Is this what you want to do ? Allan Very long story short, I have a group of steps in an SSIS package that I would like to loop through based on the values returned from an SQL SELECT statement. I've tried to set up the ForEach Loop container to process the statement, but have been unsuccessful. How do I tell the container to iteratively process the key values returned by the SELECT? |
#5
| |||
| |||
|
|
Mike: Can you tell me EXACTLY how you accomplished this scenario? I understand Allan's GENERAL instructions, but I can't seem to put it into practice. For example, Allan says, Read the SELECT statement into a Rowset variable (object) GREAT! How do I do that? Do I need a separate Data Flow to make that happen? Once I do that, how do I retrieve the values from each row? Thanks in advance. Todd C "Mike Coffey" wrote: Allan: That should do it. Thanks for the assist. mc "Allan Mitchell" wrote: Hello Mike, So you have a SELECT statement that returns a rowset. You want to loop over the rowset and execute n Tasks? Read the SELECT statement into a Rowset variable (object) Now in the ForEach loop use the ForEach ADO Enumerator type and add your variable when prompted. Is this what you want to do ? Allan Very long story short, I have a group of steps in an SSIS package that I would like to loop through based on the values returned from an SQL SELECT statement. I've tried to set up the ForEach Loop container to process the statement, but have been unsuccessful. How do I tell the container to iteratively process the key values returned by the SELECT? |
#6
| |||
| |||
|
|
Hello Todd, For reading into a Rowset variable have a look here http://www.sqlis.com/default.aspx?59 You could also do the assignment through an ExecuteSQL task http://www.sqlis.com/default.aspx?58 Regards Allan Mitchell Konesans Ltd T +44 7966 476 572 F +44 2071 008 479 http://www.konesans.com Mike: Can you tell me EXACTLY how you accomplished this scenario? I understand Allan's GENERAL instructions, but I can't seem to put it into practice. For example, Allan says, Read the SELECT statement into a Rowset variable (object) GREAT! How do I do that? Do I need a separate Data Flow to make that happen? Once I do that, how do I retrieve the values from each row? Thanks in advance. Todd C "Mike Coffey" wrote: Allan: That should do it. Thanks for the assist. mc "Allan Mitchell" wrote: Hello Mike, So you have a SELECT statement that returns a rowset. You want to loop over the rowset and execute n Tasks? Read the SELECT statement into a Rowset variable (object) Now in the ForEach loop use the ForEach ADO Enumerator type and add your variable when prompted. Is this what you want to do ? Allan Very long story short, I have a group of steps in an SSIS package that I would like to loop through based on the values returned from an SQL SELECT statement. I've tried to set up the ForEach Loop container to process the statement, but have been unsuccessful. How do I tell the container to iteratively process the key values returned by the SELECT? |
![]() |
| Thread Tools | |
| Display Modes | |
| |