title: Why does a delete statement affect an additional row?
body: <p><strong>UPDATE</strong>: </p>
  
  <p><em>I have found that including the actual execution plan was the culprit of adding that additional row affected warning.</em></p>
  
  <p><strong>ORIGINAL QUESTION:</strong></p>
  
  <p>I'm deleting a few hundreds of thousands of unnecessary records, on batches of 100 records.</p>
  
  <p>My question is that I see a warning of (1 row affected) after every 100 rows delete instruction and I'm wondering what could it be.</p>
  
  <p>My table doesn't have any trigger, and it doesn't have relationships with cascades. So, do you know of anything else that could be affecting an additional row ?.</p>
  
  <pre><code>DECLARE @LOOP bit = 1
  
  WHILE @LOOP = 1
  BEGIN
    BEGIN TRANSACTION 
  
    DELETE TOP (100) FICHERO_ASIGNACION
    FROM FICHERO_ASIGNACION 
         INNER JOIN FICHERO ON FICHERO.FIC_KEY = FICHERO_ASIGNACION.FIC_KEY
    WHERE FAT_KEY = 4 and 
          CLI_COD is null and
          FIC_BUC = 'prd.factura-venta'
  
    PRINT '100 unneeded assignments deleted'
    IF @@ROWCOUNT = 0 SET @LOOP = 0
    COMMIT TRANSACTION
  END
  </code></pre>
  
  <p>This is the result :</p>
  
  <pre><code>(100 rows affected)
  
  (1 row affected)
  100 unneeded assignments deleted
  (100 rows affected)
  
  (1 row affected)
  100 unneeded assignments deleted
  (100 rows affected)
  
  (1 row affected)
  100 unneeded assignments deleted
  ...
  ...
  </code></pre>
  
  <p>Also, on the execution plan I don't see any reference to additional tables or other searches.</p>
  
  <p><a href="https://i.stack.imgur.com/3hdSQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3hdSQ.jpg" alt="enter image description here"></a></p>
  
  <p>Thank you.</p>