Have your stored procedure output a value either by an output parameter or a scalar value.
I think there is a server variable for this - might be something like @@RowCount
Hi guys
I have an Execute SQL Task which is a simple DELETE query.. DELETE FROM SomeTable
What is the easiest way to extract the number of rows deleted into an SSIS variable?
We have a custom error handling / dynamic connections / logging tool for SSIS, and it uses variables to store records inserted/written for specific containers/tasks, but I haven't figured out delete yet.
Thanks in advance.
Jim
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
If you use SQL Task of SSIS, I suggest you to use an output parameter inside Stored Procedure ti send to the SSIS Package the number of rows deleted.
Helped? Regards,
Pedro
www.pedrocgd.blogspot.com
Used this, and replaced the SCOPE_IDENTITY of the insert with @@ROWCOUNT
http://blogs.techrepublic.
SELECT CAST(@@ROWCOUNT as INT) as foo
Then set the 1st result name to my variable.
Thanks.
Jim
Business Accounts
Answer for Membership
by: chapmandewPosted on 2009-02-16 at 06:19:39ID: 23649910
declare an ado.net connection, and a variable named @rows. at the end of your delete statement, assign the @@ROWCOUNT variable to your @rows SSIS variable....thats all there is to it.