earngreen
asked on
Record Count In Execute SQL Task
I am trying to log counts of records inserted via a sql task. Can anyone tell me how best to do this. Right now I log counts in the data flow by using VB code in a Scrip Component, but I need to be able to capture counts in the SQL Task.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sameer2010
I am not sure what you mean.
I am not sure what you mean.
@@ROWCOUNT value changes after every ddl statement. for that reason you should use it immediatly after you run your query or store that value for later use.. this what sameer2010 mean.
Create a stored procedure with an output parameter using the @@RowCount function and get it from a SQLtask inside SSIS.
FOr SQL task details check this link:
http://www.sqlis.com/post/The-Execute-SQL-Task.aspx
helped?
Regards,
Pedro
FOr SQL task details check this link:
http://www.sqlis.com/post/The-Execute-SQL-Task.aspx
helped?
Regards,
Pedro
ASKER
This worked great. Thanks
@@ROWCOUNT would be reset for every instance of insert. So, you might have to save it for logging before/after commit.