locked
How many rows has been affected??? RRS feed

  • Question

  • hi everyone,

     

    I’d like to know how many rows has been affected for this query. But I don’t want to use a  previous Sql Task style “SELECT COUNT(*) REGISTROS FROM…”

     

    Such a query like that:

     

    INSERT INTO TABLEDEST

    SELECT F1,F2,

    FROM TABLESOURCE

    WHERE <CONDITION>

     

    I’d like to retrieve that value from a later Script Task

     

    Thanks a lot for your help and thoughts,

    Thursday, April 26, 2007 11:39 AM

Answers

  • I don't know about getting it from a later script task, but you could get it from the same script task pretty easily.  You could add a SELECT @@ROWCOUNT after your insert statement and then catch the result in a variable.
    Thursday, April 26, 2007 12:38 PM

All replies

  • Moved from SSIS to t-sql forum...
    Thursday, April 26, 2007 12:27 PM
  • I don't know about getting it from a later script task, but you could get it from the same script task pretty easily.  You could add a SELECT @@ROWCOUNT after your insert statement and then catch the result in a variable.
    Thursday, April 26, 2007 12:38 PM
  • I agree.  Use @@rowcount to get the rows affected, but getting it into a SSIS variable (or something similar) is beyond this forum.  If you need to know that we can bounce it back to the SSIS forum Smile
    Thursday, April 26, 2007 1:59 PM
  • Thanks for that JayH. It was very useful.
    Friday, April 27, 2007 7:52 AM