Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Count the number of rows successfully deleted

$
0
0

I have a data flow with a conditional split to INSERT, UPDATE or DELETE rows from a table. I'd like to record the number which have been successfully deleted (for example) but I can't seem to find a way to do it. The SQL would be:

DELETE FROM [dbo].[tablename] WHERE [columnname] = ?

SELECT ? = @@ROWCOUNT

with the first "?" mapped to the feed from the conditional split and second "?" mapped to a variable (or similar).

I've seen plenty of posts relating to the use of the "Execute SQL Task" with a single row result set but this doesn't appear to be available to me:

       

I can do the deletion through the "OLE DB Command" but can't find a way for that to save the result set.

Any suggestions?


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>