delete statistics

Description

Removes statistics from the sysstatistics system table.

Syntax

delete [shared] statistics table_name [(column_name 
	[, column_name]...)]

Parameters

shared

removes simulated statistics information from sysstatistics in the master database.

table_name

removes statistics for all columns in the table.

column_name

removes statistics for the specified column.

Examples

Example 1

Delete the densities, selectivities, and histograms for all columns in the titles table:

delete statistics titles

Example 2

Deletes densities, selectivities, and histograms for the pub_id column in the titles table:

delete statistics titles(pub_id)

Example 3

Deletes densities, selectivities, and histograms for pub_id, pubdate, without affecting statistics on the single-column pub_id or the single-column pubdate:

delete statistics titles(pub_id, pubdate)

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Only the table owner or a System Administrator can use delete statistics.

See also

Commands create index, update

Utilities optdiag