FORCE A FOR LOOP TO STOP AFTER A CONDITION IS MET

khouloud Belhaj 91 Reputation points
2023-10-17T10:27:13.8166667+00:00

Hello everyone,

have a need to collect volumetric data from a source, but because I couldn't retrieve all the data at once, I created a system that collects 10,000 lines at a time. I also updated a monitor to advance to the next set of lines.

User's image

The SAS_PROFILE PACKAGE :

User's image

the expression for the loop

User's image

Every thing works fine except that my treatment doesn't stop once the condition is false

User's image

This results when all the data get inserted turns to be 0 so as a result in the expression we have 0>0 which is false but it continues to iterate through the loop.

Any help will be appreciated!

Best regards,

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,362 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,525 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 43,246 Reputation points
    2023-10-17T10:33:59.9033333+00:00

    result in the expression we have 0>0 which is false but it continues to iterate through the loop.

    No, you don't get it, you "add" some value and get a string "0>0", not a comparison result.

    Click on button "Évaluer l'expression" and you will see it.


  2. ZoeHui-MSFT 35,556 Reputation points
    2023-10-18T06:52:16.5466667+00:00

    Hi @khouloud Belhaj

    I‘m not clear about your need, could you describe what you want to via SSIS?

    If you want to load data every 10,000 lines, you may refer to this blog.

    If not, please incorrect me.

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.