SSIS 2008 Row Count Transformation - Row count return 0

17,761

Solution 1

After the Row Count, add an Aggregate Taks and select count option in the Operation tab in the Aggregate task properties. Then you can use the row count variable for further operation where it holds the total row count of the input file.

Solution 2

Row Count is processed after rows has passed.

You're adding the variable to each row as they pass through the Derived Column step, but at this time, the variable has not been updated (as it happens after all rows has passed) - so the value 0 is correct.

You -might- be able to achieve this by using an asynchronous task before your derived (but i'm not sure this'll work, it just popped to my mind). Add a Sort or Aggregate step before your Derived and try again.

Share:
17,761
Kannan Karmegam
Author by

Kannan Karmegam

Updated on June 28, 2022

Comments

  • Kannan Karmegam
    Kannan Karmegam almost 2 years

    This should be rather simple but I don't know why I get Row Count as Zero when I use ROW COUNT transformation in Data Flow Task. I have created a variable(NoOfRecords) with Package scope.

    Variable name set to variable NoOfRecords in Row Count Transformation. Image1

    Used a Derived column to assign the row count.Image2

    The package runs successfully and shows record count 265Image3

    But the Derived column shows record count as 0 instead of 265 rows. enter image description here