<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BI Monkey &#187; Loop</title>
	<atom:link href="http://www.bimonkey.com/tag/loop/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bimonkey.com</link>
	<description>James Beresford on Microsoft BI and Consulting in Sydney, Australia</description>
	<lastBuildDate>Mon, 23 Jan 2012 22:01:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>SSIS Loops that do not fail</title>
		<link>http://www.bimonkey.com/2009/08/ssis-loops-that-do-not-fail/</link>
		<comments>http://www.bimonkey.com/2009/08/ssis-loops-that-do-not-fail/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 06:12:26 +0000</pubDate>
		<dc:creator>BI Monkey</dc:creator>
				<category><![CDATA[Microsoft BI]]></category>
		<category><![CDATA[For Loop Container]]></category>
		<category><![CDATA[ForceExecutionResult]]></category>
		<category><![CDATA[Integration Services]]></category>
		<category><![CDATA[Loop]]></category>

		<guid isPermaLink="false">http://www.bimonkey.com/?p=517</guid>
		<description><![CDATA[By default, in a Loop container, if the contents of that loop fail, then the whole container is failed at the same time. Every now and then I need to create loops that do not fail when the contents fail &#8211; for example because failure is permitted or handled within the container. The way to [...]]]></description>
			<content:encoded><![CDATA[<p>By default, in a Loop container, if the contents of that loop fail, then the whole container is failed at the same time. Every now and then I need to create loops that do not fail when the contents fail &#8211; for example because failure is permitted or handled within the container.</p>
<p>The way to allow a loop to continue even if its contents have failed is to set the <strong>ForceExecutionResult</strong> property to <strong>Success</strong>, and every iteration of the loop will be treated as successful, regardless of what happens during the loop.</p>
<p>I&#8217;ve knocked up a very quick sample package demonstrating this, which can be <a title="SSIS Loops that do not fail sample package (Right click, save as)" href="http://www.bimonkey.com/uploads/ssis/Loops Permitting Failure.dtsx">downloaded here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bimonkey.com/2009/08/ssis-loops-that-do-not-fail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do&#8230; While / Until Loops in SSIS</title>
		<link>http://www.bimonkey.com/2009/07/do-while-until-loops-in-ssis/</link>
		<comments>http://www.bimonkey.com/2009/07/do-while-until-loops-in-ssis/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 07:17:41 +0000</pubDate>
		<dc:creator>BI Monkey</dc:creator>
				<category><![CDATA[Integration Services]]></category>
		<category><![CDATA[Microsoft BI]]></category>
		<category><![CDATA[For Loop Container]]></category>
		<category><![CDATA[Loop]]></category>

		<guid isPermaLink="false">http://www.bimonkey.com/?p=468</guid>
		<description><![CDATA[There isn&#8217;t an explicit Do.. While / Until loop in SSIS, but it is easy to emulate the functionality using a For Loop Container. It&#8217;s a simple 2 step process: Create a variable to hold your Until / While break value Set only the EvalExpression of the For Loop container to break when your condition [...]]]></description>
			<content:encoded><![CDATA[<p>There isn&#8217;t an explicit Do.. While / Until loop in SSIS, but it is easy to emulate the functionality using a For Loop Container. It&#8217;s a simple 2 step process:</p>
<ol>
<li>Create a variable to hold your Until / While break value</li>
<li>Set <span style="text-decoration: underline;">only</span> the EvalExpression of the For Loop container to break when your condition is met in the variable</li>
</ol>
<p>I&#8217;ve attached an example which uses the variable <span style="color: #800080;">User::WhileCondition</span>. The For Loop container stops executing when this EvalExpression is no longer true:</p>
<blockquote><p>@[<span style="color: #800080;">User::WhileCondition</span>] &lt; 5</p></blockquote>
<p>The script task within the loop increases <span style="color: #800080;">User::WhileCondition</span> by 1 on each iteration. When it reaches 5, the loop stops executing.</p>
<p>The scenario I was using this was for monitoring a folder where files might keep arriving even during processing. So after the Foreach loop over the folder ran, the script task would check to see if any files remained in the folder. If there were, the loop would run again and process the new files. Once there were no files left, the Do.. Until loop evaluated that there were zero files and stopped running.</p>
<p>The sample package can be found <a title="SQL 2005 SSIS Do While / Until Sample (Right Click, Save As)" href="http://www.bimonkey.com/uploads/ssis/Do%20While%20Loop.dtsx">here for 2005</a> and guidelines on use are <a title="Using samples from BI Monkey" href="http://www.bimonkey.com/support/using-ssis-samples-from-this-site/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bimonkey.com/2009/07/do-while-until-loops-in-ssis/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

