Friday, March 23, 2012

How many rows has been affected?

hi everyone,

I’d like to know how many rows has been affected for this query. But I don’t want to use aprevious 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,

Moved from SSIS to t-sql forum...|||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.
|||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|||Thanks for that JayH. It was very useful.

No comments:

Post a Comment