sp_flushstats

Description

Flushes statistics from in-memory storage to the systabstats and sysstatistics system tables.

Syntax

sp_flushstats [objname]

Parameters

objname

is the name of a table.

Examples

Example 1

Flushes statistics for the titles table:

sp_flushstats titles

Usage

Permissions

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

Granular permissions enabled

With granular permissions enabled, you must be a user with monitor qp performance privilege.

Granular permissions disabled

With granular permissions disabled, you must be a user with sa_role.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

Event

Audit option

Command or access audited

Information in extrainfo

38

exec_procedure

Execution of a procedure

  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect