Answers

Question and Answer:

  Home  Basic SQL Server

⟩ Tell me the phases a transaction has to undergo?

The several phases a transaction has to go through are listed here. Database is in a consistent state when the transaction is about to start.

1. The transaction starts processing explicitly with the BEGIN TRANSACTION statement.

2. Record is written to the log when the transaction generates the first log record for data modification.

3. Modification starts one table at time. Here database is in inconsistent state.

4. When all of the modifications have completed successfully and the database is once again consistent, the application commits the transaction.

5. If some error it undoes (or rolls back) all of the data modifications. This process returns the database to the point of consistency it was at before the transaction started.

 115 views

More Questions for you: