About Transaction Logs

Transaction logs are areas reserved by SQL Server to record changes that are made to a database. Each database has its own transaction log. Every change made to a database is automatically recorded in its transaction log.

Transaction logs are used by SQL Server during automatic recovery. They should not be queried with Transact-SQL statements.

The transaction log records data modification requests (INSERT, UPDATE, or DELETE statements) as they are executed. When a transaction begins, a begin transaction event is recorded in the log. This event is used during automatic recovery to determine the starting point of a transaction.

As each data modification statement is received, it is recorded in the log. The change is always recorded in the log before that change is made in the database itself. This type of log is called a write-ahead log.

The transaction log is shared by all users of the database. Multiple changes are frequently recorded each time a log page is written to the database device. This greatly improves I/O efficiency.

Caution A database's transaction log is contained in its syslogs system table. Do not try to access the syslogs table. It is for the internal use of SQL Server only.