Link to home
Start Free TrialLog in
Avatar of Alex A
Alex A

asked on

SSIS: counting rows.

Hi, I need to count rows in the source flat file. Also, have to count how many were loaded in the destination table.
Thanks.
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

If we're talking an SSIS package, there is a Row Count transformation that you can insert between the source and destination, that will count the rows in the source and save to a variable.  Then you can use that variable however you wish.

Create an variable, int data type, name it something like 'iRowCount'
Insert the Row Count transform between source and destination in your data flow, connecting the arrows.
Double-click on the Row Count transform, and set the Variable Name property to your variable.

Then, tell us what you wish to do with this count.
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
btw, if your company can cough up $1,000 per environment, Pragmatic Works has a suite of components called Task Factory, where the upsert destination task which allows for both inserting and updating as a destination, and it will save the number of rows inserted and updated to variables for later use.

Extremely handy for data warehouse work.