Update query cancelled by user

10,030

A single update statement will not update some rows. It's all rows or none

This is the atomicity in the ACID properties which SQL server respects well.

Atomicity requires that each transaction is "all or nothing": if one part of the transaction fails, the entire transaction fails, and the database state is left unchanged. An atomic system must guarantee atomicity in each and every situation, including power failures, errors, and crashes.

Then the commit is at the end of the statement, so when you cancel there's no commit

Share:
10,030
MaxRecursion
Author by

MaxRecursion

Student/IT Professional/ Windows Phone Enthusiast/ Micro-Blogger/ Internet freak/ Computer fanatic /StackExchange Fan/ Android Developer http://MaxRecursion.wordpress.com/ http://twitter.com/MaxRecursion

Updated on July 24, 2022

Comments

  • MaxRecursion
    MaxRecursion almost 2 years

    I have a table that has millions of rows.

    Accidentally I wrote an update query over a table without where clause and clicked execute.

    It started executing. After two seconds I realized the query is wrong and I clicked 'Stop' button in Sql Server Management Studio. The query execution was stopped, this all happened within 7 seconds.

    Now I am curious to know if there are any rows affected. If any which are they? How to find it?

  • Kermit
    Kermit over 11 years
    How does this answer the question?
  • Marc
    Marc over 11 years
    The question is "Now I am curious to know if there any rows affected if any which are they". There's not so
  • MaxRecursion
    MaxRecursion over 11 years
    So as per my understanding no rows were changed right? Thanks a lot. Is there any way to verify?
  • Kermit
    Kermit over 11 years
    That's a statement. The question is, "Ho to find it."
  • Kermit
    Kermit over 11 years
    @AkshayKulkarni I would recommend you read this answer to help with your issue.
  • Marc
    Marc over 11 years
    @njk there's no rollback to do. No commit was made