update all statistics

Description

Updates all statistics information for a given table. You can run update all statistics on a single data partition.

Syntax

update all statistics table_name [partition data_partition_name]

Parameters

table_name

is the name of the table for which statistics are being updated.

data_partition_name

is the name of the partition to be updated. Statistics for each local index partition on the data partition is updated. Does not update statistics for global indexes.

Examples

Example 1

Updates all statistics for the salesdetail table:

update all statistics salesdetail

Example 2

Updates all statistics for the smallsales partition on salesdetail table:

update all statistics salesdetail partition smallsales

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

update all statistics permission defaults to the table owner and is not transferrable.

See also

Commands update statistics, update index statistics, update statistics, update table statistics