SQL Server and mid-transaction connection loss

What happens if you lose contact in the middle of a transaction?

I assume that if the transaction is never committed and can be executed again, but ... is there a way I can connect and roll it back to the saved point and continue with the things that I already have?

Sincerely.

+8
sql-server tsql sql-server-2008 transactions
Feb 12 '11 at 13:44
source share
2 answers

If you lose a connection in the middle of a transaction, you can no longer re-enter this transaction from another connection. If the connection is deleted, SQL Server will automatically roll back any uncommitted transactions. Therefore, if this happens, just reconnect, and you will find your database in the same state as before the start of the transaction (provided that, of course, there are no other users who could change them between them.

+8
Feb 12 '11 at 13:53
source share

Typically, any transaction break will be rolled back. Whether the client disconnects, CommandTimeout, or the server restarts.

This is Atomic's ACID

The ability to "pick up" the transaction where it stopped does not make sense

  • other transactions that occur / LSN transaction will be out of order
  • internal structures change as part of a record (indexes, etc.) / database is incompatible
+2
Feb 12
source share



All Articles