[Memo] sp_autostats

Displays or changes the automatic UPDATE STATISTICS setting for a specific index and statistics, or for all indexes and statistics for a given table or indexed view in the current database.

Examples

A. Display the current status of all indexes for a table
This example displays the current statistics status of all indexes on the authors table.

USE pubs
EXEC sp_autostats authors

B. Enable automatic statistics for all indexes of a table
This example enables the automatic statistics setting for all indexes of the authors table.

USE pubs
EXEC sp_autostats authors, ‘ON’

C. Disable automatic statistics for a specific index
This example disables the automatic statistics setting for the au_id index of the authors table.

USE pubs
EXEC sp_autostats authors, ‘OFF’, au_id

REFERENCE : MSDN Library

최 재훈

블로그, 페이스북, 트위터 고성능 서버 엔진, 데이터베이스, 지속적인 통합 등 다양한 주제에 관심이 많다.
Close Menu