@@ROWCOUNT when cascade delete?

  • Hi,

    Is there an easy way to see how many rows got affected - both parent and children - when I delete from a parent and there is a cascade delete FK between child and parent?

    In other words,

    if I have table Parent with 1 row

    and table Child with 10 rows that belong to that parent above

    and then I do DELETE from parent, I want to see 11 as a number of rows affected

    Thanks!

  • Afaik, there is no way to get that number back from SQL. In theory, SQL could have had to cascade thru a dozen tables (or more).

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • thanks!

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

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