How to cross check how many rows got deleted

  • Hi,

    I am new to SSIS.

    I have a table with 10 rows. The table has a column with column name id. I having 5 rows with id=1, 3 rows with id =2 and 2 rows with id=3

    And i have a execute SQL task in my ssis package with a delete statement as

    delete from tname where id=?

    My doubt is how can i cross check the deletion action, has deleted the exact no of rows inside the DTS package. How to implement this logic inside the DTS. Which task will be useful in this regard.

    Thanks,

  • You can use the execute SQL task to populate an Int32 variable with the count of rows. This article has some good examples - http://www.sqlis.com/58.aspx

  • Thanks Tom

  • You can also capture the deleted data itself from the DELETE 'cursor' that SQL 2005 provides within the DELETE statement. Cursors also exist for inserts and updates. Look at the help topic for 'OUTPUT clause' for an example.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply