Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

For Loop expression using logical OR (||) - odd results

$
0
0

Hi,

I've got the following expression as my EvalExpression in my for loop:

 @globalError>@desiredError || @nosEpochs<@maxEpochs  

When testing the above I've set the conditions so the first condition (@globalError>@desiredError) is met before the second condition (@nosEpochs<@maxEpochs) however instead of the loop ending when either of the conditions is met it only ends when both conditions are met - which means the || is acting like an &&. So I swapped the operators around and used the following expression:

 @globalError>@desiredError && @nosEpochs<@maxEpochs

and oddly the for loop ends when the first condition is met even though the second condition has not met - which is an || right? 

I'm obviously missing something here - can someone point out my glaring mistake? using 2008 R2.

 



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>