• A more efficient way of coding this is to perform the deletion and then check @@ROWCOUNT afterwards, thus hitting the table once per deletion rather than twice.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.