title: Is it possible for SQL Server to report an incorrect number of rows affected?
body: <p>I have a utility which:</p>
  
  <ol>
  <li>grabs sql commands from a flat text file</li>
  <li>executes them sequentially against SQL Server located on the same machine</li>
  <li>and reports an error if an UPDATE command affects ZERO ROWS (there should never be an update command in this file that doesn't affect a record, hence it being recorded as an error)</li>
  </ol>
  
  <p>The utility also logs any failed commands.</p>
  
  <p><strong>Yet the final data in the database seems to be wrong/stale, even though my utility is reporting no failed updates and no failed commands.</strong></p>
  
  <p>I know the first and most obvious culprit is some kind of logic or runtime error in my programming of the utility itself, but I just need to know of it's THEORETICALLY possible for SQL Server to report that at least one row was affected and yet no apply the change.</p>
  
  <p>If it helps, the utility always seems to correctly execute the same number of commands and the final stale/wrong data is always the same i.e. it seems to correctly execute a certain number of commands that are being successfully queried against the database, then failing.</p>
  
  <p>Thanks.</p>
  
  <p>EDIT:</p>
  
  <p>I should also note that this utility is exhibiting this behavior across 4 different production servers each with their own dedicated local database server, and that these are beefy machines with 8-16 GB RAM each that are managed by a professional sysadmin.</p>