Applies To: SQL Server 2014, SQL Server 2016 Preview
Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).
Returns statistics information about columns and indexes on the specified table.
This feature will be removed in the next version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. To obtain information about statistics, query the sys.stats and sys.stats_columns catalog views.
Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database
The following example creates single-column statistics for all eligible columns for all user tables in the AdventureWorks2012 database by executing sp_createstats. Then, sp_helpstats is run to find the resultant statistics created on the Customer table.
USE AdventureWorks2012; GO EXEC sp_createstats; GO EXEC sp_helpstats @objname = 'Sales.Customer', @results = 'ALL';
Here is the result set.