checkpoint

Description

Writes all dirty pages (pages that have been updated since they were last written) to the database device.

Syntax

checkpoint [all | [dbname[, dbname, dbname, ........]]

Examples

Example 1

Writes all dirty pages in the current database to the database device, regardless of the system checkpoint schedule:

checkpoint

Usage


Automatic checkpoints

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

The permission checks for checkpoint differ based on your granular permissions settings.

Granular permissions enabled

With granular permissions enabled:

  • To execute checkpoint on a particular database you must be the database owner or have either the checkpoint or own database (on the database) privilege.

  • To execute checkpoint all, you must be the database owner of all applicable databases or have either the checkpoint any database privilege or own and database privilege. Otherwise checkpoint all runs against those databases in which you have permission to run checkpoint.

Granular permissions disabled

With granular permissions disabled:

  • To execute checkpoint database, you must be the database owner or be a user with any of these:

    • sa_role, or,

    • replication_role, or,

    • oper_role

  • To execute checkpoint all, you must be the database owners of all applicable databases or a user with any of these:

    • sa_role, or,

    • replication_role

Otherwise, checkpoint all only runs against those database you own. .

See also

System procedures sp_configure, sp_dboption