lduvall (8/7/2016)
Phil, I added the @RowCount and @ErrorRowCount variables and set a derived column to add the two together and mapped it to my error table destination, but it's not working. It's saying 0. I thought maybe it is because my first test file had the error record on line 1, but I flipped it and put it on the final line and it's still not capturing anything. Could it be because it processes the errors first and it hasn't assigned the value to the completed row yet? I'm attaching photos of the data flow and the derived column. I have the default for the variables set to 0 so I don't think it's a matter of trying to add NULL + line number.
I must apologise. I have misled you (and learned something myself in the process). I just checked BOL regarding the Rowcount transformation, and found the following text:
The transformation stores the row count value in the variable only after the last row has passed through the transformation. Therefore, the value of the variable is not updated in time to use the updated value in the data flow that contains the Row Count transformation.
So we need to find a different way of populating the variables. This can be done within script components (one for each path through the data flow), but I don't have time to write the code just now. I will try to post again later today with more detail.
If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.