This article mainly shares the process of transaction execution in SQL Server.
Note that this is only about the process, not the lock information, the information about the lock, there will be a special article to discuss later.
The execution flow of the transaction is as follows, from 01 steps to 08 steps.
1,sqlserver Accepting a transaction request
2, the storage engine starts a transaction (with a unique transaction identity) and writes the transaction log to the cache log buffer
3, the storage engine writes transaction data to cache DB buffer
4, when step 3 is complete, the storage engine commits the transaction identity when the cache log
5. Log the logs in log buffer to write the disk
6, after the log is written to disk completion, the storage engine returns a successful commit to the client transaction (note that at this point the data is not actually written to disk).
7, wait for trigger checkpoint or lazy write
8, data is written to disk
transactions for SQL Server