Showing posts with label processing. Show all posts
Showing posts with label processing. Show all posts

Monday, February 27, 2012

Help -- How do I exit a Foreach Loop

I have a foreach loop that is processing files in a directory. One of the tasks is the execute sql task that calls a stored proc. If this stored proc returns a certain value then I need to exit the loop and not process any more files. But I have been unable to figure out how to make this happen.

Any help would be greatly appreciated.

Thanks!

GN

Hi,

I am not sure whether this will work or not. But just try. In the 'Foreach loop' container, select 'Expressions' tab and assign a boolean variable to the propery 'Disable'. Then based on the result, when required, set the value of the variable to 'True'. If it does not work, try this option for 'ForceExectionResult' also.

Let me know if any one of it works.

|||

GN wrote:

I have a foreach loop that is processing files in a directory. One of the tasks is the execute sql task that calls a stored proc. If this stored proc returns a certain value then I need to exit the loop and not process any more files. But I have been unable to figure out how to make this happen.

Any help would be greatly appreciated.

Thanks!

GN

have you considered using the script task instead?|||

Place the workflow in a sequence inside the ForEach Loop.

Place a script task at the beginning of the loop with a precedence constraint going to the sequence.

Place an expression on the precedence constraint to only execute if a variable is true, call the variable, "ExecuteBody". ExecuteBody==true

Set op to expression only

When the loop should terminate, set the ExecuteBody variable to false. The loop will traverse the entire remaining collection, but because there is nothing to execute, it will rip through it extremely fast and terminate.

K

Help - Cube Processing

All,
I m at a loss to understand whats happened to the data warehouse I manage.
Everything was OK up until about 2 weeks ago then overnight the daily Cube
processing jumped from about 15 minutes to nearly 45 minutes/Partition.
I've Defraged and reindexed all the fact tables, that helped for about 2
days but no has no effect.
The server config is
4 x Xeon 2.8 Processors (multi threading applied, effectivly 8 Pros)
4GB of Memory (AWE Disabled)
2GB Sys Paging File
5 Drives all Raid 0+1I would suggest that you scan through your system using the tips and tricks
suggested in the following two white papers:
http://www.microsoft.com/technet/pr...n/ansvcspg.mspx
http://www.microsoft.com/technet/pr...n/anservog.mspx
Both contain lots of great recommendations on how to deal with increased
processing times.
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jason Lees" <JasonLees@.discussions.microsoft.com> wrote in message
news:6EAFB483-D8D0-4770-B1B3-78766465757F@.microsoft.com...
> All,
> I m at a loss to understand whats happened to the data warehouse I manage.
> Everything was OK up until about 2 weeks ago then overnight the daily Cube
> processing jumped from about 15 minutes to nearly 45 minutes/Partition.
> I've Defraged and reindexed all the fact tables, that helped for about 2
> days but no has no effect.
> The server config is
> 4 x Xeon 2.8 Processors (multi threading applied, effectivly 8 Pros)
> 4GB of Memory (AWE Disabled)
> 2GB Sys Paging File
> 5 Drives all Raid 0+1
>
>

Help - Cube Processing

All,
I m at a loss to understand whats happened to the data warehouse I manage.
Everything was OK up until about 2 weeks ago then overnight the daily Cube
processing jumped from about 15 minutes to nearly 45 minutes/Partition.
I've Defraged and reindexed all the fact tables, that helped for about 2
days but no has no effect.
The server config is
4 x Xeon 2.8 Processors (multi threading applied, effectivly 8 Pros)
4GB of Memory (AWE Disabled)
2GB Sys Paging File
5 Drives all Raid 0+1
I would suggest that you scan through your system using the tips and tricks
suggested in the following two white papers:
http://www.microsoft.com/technet/pro.../ansvcspg.mspx
http://www.microsoft.com/technet/pro.../anservog.mspx
Both contain lots of great recommendations on how to deal with increased
processing times.
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jason Lees" <JasonLees@.discussions.microsoft.com> wrote in message
news:6EAFB483-D8D0-4770-B1B3-78766465757F@.microsoft.com...
> All,
> I m at a loss to understand whats happened to the data warehouse I manage.
> Everything was OK up until about 2 weeks ago then overnight the daily Cube
> processing jumped from about 15 minutes to nearly 45 minutes/Partition.
> I've Defraged and reindexed all the fact tables, that helped for about 2
> days but no has no effect.
> The server config is
> 4 x Xeon 2.8 Processors (multi threading applied, effectivly 8 Pros)
> 4GB of Memory (AWE Disabled)
> 2GB Sys Paging File
> 5 Drives all Raid 0+1
>
>