sys.sp_statistics
The spstatistics system stored procedure returns a list of all indexes and statistics on a specified table or indexed view.
What changes
- Input
- Not stated in the Microsoft summary.
- Output or change
- Not stated in the Microsoft summary.
Syntax at a glance
sys.sp_statistics
[ @table_name = ] N'table_name'
[ , [ @table_owner = ] N'table_owner' ]
[ , [ @table_qualifier = ] N'table_qualifier' ]
[ , [ @index_name = ] N'index_name' ]
[ , [ @is_unique = ] 'is_unique' ]
[ , [ @accuracy = ] 'accuracy' ]
[ ; ]
Work example
The spstatistics system stored procedure returns a list of all indexes and statistics on a specified table or indexed view.
Read the parameter list and identify the provider operation it supports. Do not call it directly from application T-SQL.
Check your work Why does Microsoft limit direct calls to this procedure?
Open Microsoft Learn for full syntax, permissions, and details for your version.