Hi, Another classic example of something silly I must be doing :( I have a "Foreach Loop Container" which uses a "Foreach ADO Enumerator". The object source is a recordset variable. Inside the "Foreach Loop Container", a lot of things are happening - some Execute SQL Tasks, Send Mail Tasks, Script Tasks and also a couple of Sequence Containers. Now, I am getting 2 records in the recordset, but, the "Foreach Loop Container" executes just once. Any Ideas? Thanks in advance. Regards,
Hello B@ns: By "recordset variable" I assume you mean type: Object ? How are you filling that variable? I use an Execute SQL Task. I set the Result Set property to Full Result Set (NOT Single Row). HTH -- Todd C [If this response was helpful, please indicate by clicking the appropriate answer at the bottom] [quoted text, click to view] "B@ns" wrote: > Hi, > > Another classic example of something silly I must be doing :( > > I have a "Foreach Loop Container" which uses a "Foreach ADO Enumerator". > The object source is a recordset variable. > > Inside the "Foreach Loop Container", a lot of things are happening - some > Execute SQL Tasks, Send Mail Tasks, Script Tasks and also a couple of > Sequence Containers. > > Now, I am getting 2 records in the recordset, but, the "Foreach Loop > Container" executes just once. > > Any Ideas? > > Thanks in advance. > Regards,
Hi Todd, You are right, the recordset variable is of type System.Object. I am filling this object in a Data Flow Task whose destination is a Recordset Destination. Mysteriously, I am not able to re-produce this error :( Now, the Foreach Loop Container is indeed looping through all the records. But, this makes me more worried. Thanks again. Regards, B@ns [quoted text, click to view] "Todd C" wrote: > Hello B@ns: > > By "recordset variable" I assume you mean type: Object ? How are you filling > that variable? I use an Execute SQL Task. I set the Result Set property to > Full Result Set (NOT Single Row). > > HTH > -- > Todd C > > [If this response was helpful, please indicate by clicking the appropriate > answer at the bottom] > > > "B@ns" wrote: > > > Hi, > > > > Another classic example of something silly I must be doing :( > > > > I have a "Foreach Loop Container" which uses a "Foreach ADO Enumerator". > > The object source is a recordset variable. > > > > Inside the "Foreach Loop Container", a lot of things are happening - some > > Execute SQL Tasks, Send Mail Tasks, Script Tasks and also a couple of > > Sequence Containers. > > > > Now, I am getting 2 records in the recordset, but, the "Foreach Loop > > Container" executes just once. > > > > Any Ideas? > > > > Thanks in advance. > > Regards,
B@ns: If you are using a DataFlow to populate the variable, then I assume that you are doing some transforms to get it to its final values? If all you have is a Source and RecordSet Destination, then you might consider replacing that whole DataFlow with an Execute SQL Task using a SELECT statement and FullResultSet. Might simplify your design a little. Ahhhh, errors that fix themselves! Only in software! When my car breaks down, it STAYS broken! -- Todd C [quoted text, click to view] "B@ns" wrote: > Hi Todd, > > You are right, the recordset variable is of type System.Object. > > I am filling this object in a Data Flow Task whose destination is a > Recordset Destination. > > Mysteriously, I am not able to re-produce this error :( > Now, the Foreach Loop Container is indeed looping through all the records. > But, this makes me more worried. > > Thanks again. > > Regards, > B@ns > > "Todd C" wrote: > > > Hello B@ns: > > > > By "recordset variable" I assume you mean type: Object ? How are you filling > > that variable? I use an Execute SQL Task. I set the Result Set property to > > Full Result Set (NOT Single Row). > > > > HTH > > -- > > Todd C > > > > [If this response was helpful, please indicate by clicking the appropriate > > answer at the bottom] > > > > > > "B@ns" wrote: > > > > > Hi, > > > > > > Another classic example of something silly I must be doing :( > > > > > > I have a "Foreach Loop Container" which uses a "Foreach ADO Enumerator". > > > The object source is a recordset variable. > > > > > > Inside the "Foreach Loop Container", a lot of things are happening - some > > > Execute SQL Tasks, Send Mail Tasks, Script Tasks and also a couple of > > > Sequence Containers. > > > > > > Now, I am getting 2 records in the recordset, but, the "Foreach Loop > > > Container" executes just once. > > > > > > Any Ideas? > > > > > > Thanks in advance. > > > Regards,
Hi Todd, I am not using any transformations, so your suggestion definitely holds good! Thanks. :) You are right again - this happens only in software. And it's dangerous. Thanks and Regards, B@ns [quoted text, click to view] "Todd C" wrote: > B@ns: > > If you are using a DataFlow to populate the variable, then I assume that you > are doing some transforms to get it to its final values? If all you have is a > Source and RecordSet Destination, then you might consider replacing that > whole DataFlow with an Execute SQL Task using a SELECT statement and > FullResultSet. Might simplify your design a little. > > Ahhhh, errors that fix themselves! Only in software! When my car breaks > down, it STAYS broken! > -- > Todd C > > "B@ns" wrote: > > > Hi Todd, > > > > You are right, the recordset variable is of type System.Object. > > > > I am filling this object in a Data Flow Task whose destination is a > > Recordset Destination. > > > > Mysteriously, I am not able to re-produce this error :( > > Now, the Foreach Loop Container is indeed looping through all the records. > > But, this makes me more worried. > > > > Thanks again. > > > > Regards, > > B@ns > > > > "Todd C" wrote: > > > > > Hello B@ns: > > > > > > By "recordset variable" I assume you mean type: Object ? How are you filling > > > that variable? I use an Execute SQL Task. I set the Result Set property to > > > Full Result Set (NOT Single Row). > > > > > > HTH > > > -- > > > Todd C > > > > > > [If this response was helpful, please indicate by clicking the appropriate > > > answer at the bottom] > > > > > > > > > "B@ns" wrote: > > > > > > > Hi, > > > > > > > > Another classic example of something silly I must be doing :( > > > > > > > > I have a "Foreach Loop Container" which uses a "Foreach ADO Enumerator". > > > > The object source is a recordset variable. > > > > > > > > Inside the "Foreach Loop Container", a lot of things are happening - some > > > > Execute SQL Tasks, Send Mail Tasks, Script Tasks and also a couple of > > > > Sequence Containers. > > > > > > > > Now, I am getting 2 records in the recordset, but, the "Foreach Loop > > > > Container" executes just once. > > > > > > > > Any Ideas? > > > > > > > > Thanks in advance. > > > > Regards,
Don't see what you're looking for? Try a search.
|