locked
RowCount RRS feed

  • Question

  • In a Data Flow Task, i want to do a RowCount of the Source and the Rowcount of the Target.  I know i can get this done by writing a code to count the records in Source and Target.  But, i want to know if there is a way, i can use the RowCount tool to do this.

    Thanks.

     


    NSG12
    Wednesday, March 24, 2010 7:30 PM

Answers

  • You can use RowCount(SourceRC) after the source to get the number of records coming from source.

    Next before the Destination(DestRC) put a rowcount to get the number of records going to destination.

    Set the Error Configuration and set onError to redirect records. Connect the red arrow to another RowCount(ErrorRC).

     

    Now in the control flow you can use the SourceRC as it is.

    To get the number of records inserted to the destination use: DestRC - ErrorRC.


    Sudeep's Blog
    • Proposed as answer by Todd McDermid Wednesday, March 24, 2010 8:18 PM
    • Marked as answer by Zongqing Li Wednesday, March 31, 2010 7:58 AM
    Wednesday, March 24, 2010 7:41 PM

All replies

  • You can use RowCount(SourceRC) after the source to get the number of records coming from source.

    Next before the Destination(DestRC) put a rowcount to get the number of records going to destination.

    Set the Error Configuration and set onError to redirect records. Connect the red arrow to another RowCount(ErrorRC).

     

    Now in the control flow you can use the SourceRC as it is.

    To get the number of records inserted to the destination use: DestRC - ErrorRC.


    Sudeep's Blog
    • Proposed as answer by Todd McDermid Wednesday, March 24, 2010 8:18 PM
    • Marked as answer by Zongqing Li Wednesday, March 31, 2010 7:58 AM
    Wednesday, March 24, 2010 7:41 PM
  • Thanks. But the errorRC returns 0 as the value.

    This is what i did. 

    Put Source.  Put Rowcount for Source.  This works fine.

    Put Destination.  Extended to Red Arrow to Rowcount. and in error configuration-Redirect row.

    This returned 0 as value, though it inserted some records.

     


    NSG12
    • Edited by NSG12 Wednesday, March 24, 2010 8:13 PM
    Wednesday, March 24, 2010 8:13 PM
  • In that case all the records are going into the destination. use DestRC(as per my eg) this will give you the desired result.
    Sudeep's Blog
    Wednesday, March 24, 2010 8:17 PM
  • Thanks, i got it what you are saying.
    NSG12
    Wednesday, March 24, 2010 8:27 PM