I began running two update queries three days ago. I was using SQL Server Management Studio in a single window. The window looked like this:
UPDATE mytable SET Field1 = Value1 UPDATE mytable SET Field2 = Value2
There are actually some joins to other tables but you get the idea. There was no BEGIN TRANSACTION or anything like that. From a NOLOCK query on mytable I can tell that all of the Field1 values have been updated successfully. The start_time in sp_whoisactive is just from about an hour ago, leading me to believe that the second update statement just started an hour ago and the first one has completed. In the SSMS query window I clicked Cancel Query. The status bar in the window shows "Canceling...". sp_whoisactive shows that SPID 110 has a value of 2 for open_tran_count. If I run sp_whoisactive once, then a second time I can see that writes are continuing to increase. The status is SUSPENDED. I would be expecting to see ROLLBACK, but since there are two update statements maybe I'm wrong.
The question is this. I'm ok with losing updates from the second statement, but don't want to lose the ones from the first statement. If I use the KILL statement will it roll back the first update also, or just the second? Also, if I do use the KILL statement should the ROLLBACK take just an hour or two since it has only been running for an hour?
Thanks!
P.S. - I had intended to add indexes before running this and forgot, left the office on Friday, and now I'm stuck with this little gem!