
Fig 1: The Row Count Transformation
In this post I will be covering the Row Count Transformation. The sample package can be found
here for 2005 and guidelines on use are
here.
What does the Row Count Transformation do?
The Row Count Transformation counts the number of rows that have passed through a Data Flow and puts that count into a variable. Configuration is simple – all you need to do to is specify the variable name that will hold the row count on the first page of the editor (down at the bottom under “Custom Properties”). There’s a little gotcha here – whilst the tab for ‘
Input Columns” is active, if you try to select any columns it will return an error and not allow you to continue.
It is worth noting that the variable is only updated once
all rows of data have passed through the data flow – i’ve demonstrated this in the sample package by adding the variable to a column in a Derived Column – it returns zero all the way through, so you cannot use the Row Count as a row number generator.
Where would you use the Row Count Transformation?
The most obvious use is in logging processes – for example counting input rows versus outputs rows or counting failed rows. Anywhere you need to track the number of rows being passed through a given data flow.
MSDN Documentation for the Row Count Transformation can be found here for
2008 and here for
2005.
Get More from the original blog...