BEGIN TRANSACTION UPDATE mytable SET Name = @Name1 WHERE Id = @Id1 IF @@ROWCOUNT = 1 BEGIN UPDATE mytable SET Name = @Name2 WHERE Id = @Id2 IF @@ROWCOUNT = 1 BEGIN UPDATE mytable SET Name = @Name3 WHERE Id = @Id3 IF @@ROWCOUNT = 1 BEGIN COMMIT TRANSACTION END ELSE BEGIN ROLLBACK TRANSACTION END END ELSE BEGIN ROLLBACK TRANSACTION END END ELSE BEGIN ROLLBACK TRANSACTION ENDLets say there is a match for @Id1 and @Id2 but there is no match for @Id3, everything seem to rollback just fine but my application tells me that 2 rows were affected.