Transact-SQL Reference

CHECKPOINT

Forces all dirty pages for the current database to be written to disk. Dirty pages are data or log pages modified after entered into the buffer cache, but the modifications have not yet been written to disk. For more information about log truncation, see Truncating the Transaction Log.

Syntax

CHECKPOINT

Remarks

The CHECKPOINT statement saves time in a subsequent recovery by creating a point at which all modifications to data and log pages are guaranteed to have been written to disk.

Checkpoints also occur:

The SHUTDOWN WITH NOWAIT statement shuts down SQL Server without executing a checkpoint in each database. This may cause the subsequent restart to take a longer time than usual to recover the databases on the server.

SQL Server 2000 also automatically checkpoints any database where the lesser of these conditions occur:

A database is in log truncate mode when both these conditions are TRUE:

Permissions

CHECKPOINT permissions default to members of the sysadmin fixed server role and the db_owner and db_backupoperator fixed database roles, and are not transferable.

See Also

ALTER DATABASE

Checkpoints and the Active Portion of the Log

recovery interval Option

Setting Database Options

SHUTDOWN