In SSIS, how do I get the number of rows returned from the Source that SHOULD be processed

前端 未结 5 1932
感情败类
感情败类 2020-12-11 05:43

I am working on a project to add logging to our SSIS packages. I am doing my own custom logging by implementing some of the event handlers. I have implemented the OnInformat

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-11 06:47

    Here is what I currently do. It's super tedious, but it works.

    1)

    2) I have a constant "1" value on all of the records. They are literally all the same.

    3) Using a multicast step, I send the data flow off in 2 directions. Despite all being the same, we still have to sort by that constant value.

    4) Use an aggregate step to aggregate on that constant and then resort it in order to join with the bottom data flow (it holds all of the actual data records with no aggregation).

    Doing this allows me to have my initial row count.

    1. Later on, shown below, is use a conditional split step and do the same thing again after applying your condition. If the row count is the same, everything is fine and there are no problems.

    If the row count is not the same, something is wrong.

    This is the general idea for the approach for solving your problem without having to use another data flow step.

    TLDR:

    Get a row count for 1 of the conditions by using a multicast, sort by some constant value, and aggregation step.

    Do a sort and merge to grab the row count.

    Use a conditional split and do it again.

    If the pre and post row counts are the same, do this.

    If the pre and post row counts are not the same, do that.

提交回复
热议问题