Using the Transaction Log in SQL Server

Microsoft® SQL Server™ has a feature common to most production scale databases that does not exist in Microsoft® Access. The transaction log is a chronological record of all activity that occurs on the server. When a record is added to a table, a copy of the record is written to the transaction log. When a record is deleted, the transaction log records the data that was removed. Every time an existing record is changed, the transaction log records both the old value and the new value. The same details concerning the creation and deletion of tables, views, stored procedures, rules, defaults, and so on, are also stored. Every multistep transaction is recorded, along with whether it was committed or rolled back. Every entry to the transaction log contains a timestamp, an incrementing number to order all entries.

Truncate Log on Checkpoint

Should you decide that you do not need a transaction log, you can set the trunc. log on chkpt. option. With trunc. log on chkpt., you can ignore maintenance of the transaction log, and your database behaves much like an Access database. SQL Server continues to use the transaction log and you continue to gain its benefits; however, less space and no maintenance are required.

Database Replication

Database replication is also based on the transaction log. If you have marked a table for replication, it is recorded in the database transaction log. A special process called the log reader monitors the log and sends changes marked for replication to the distribution database.

See Also
Transaction Logs Setting Database Options

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.