Execute a package based on conditions

gbii1970 1 Reputation point
2021-05-22T15:42:21.787+00:00

Hi

I need to add a step to a SSIS package that takes the counts of 2 tables. If different then the package needs to run, if the same then it shouldn't run. I also need to build in a Force Execute parameter - if the count as described is different OR the Force Execute parameter = 1 then run the package, otherwise just end as success but without running the subsequent steps.

hope this is clear! Thanks.

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,416 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 30,881 Reputation points
    2021-05-24T07:31:58.283+00:00

    Hi @gbii1970 ,

    You may refer this link for details. Hope it could give you some ideas.

    1.Create a DataFlow Task which moves data from source to destination.

    2.Create have an Execute SQL task which basically counts all rows from TableA and maps it to variable count1 eg. Source table

    3.Create a Execute SQL task which basically counts all rows from TableB and maps it to variable count2 eg. Destination Table

    4.Create an Execute Package task

    5.Make a precedence constraint with an expression saying Count1 != count2

    Regards,

    Zoe


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

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Hot issues October

    0 comments No comments