This script provides us the statistics details of all tables on a database on which this query is executed. This script is tested in SQL Server 2012, SQL Server 2014, SQL Server 2016 and SQL Server 2017.


-> Below query can be used to get the details of statistics on a table.


select distinct object_name(a.object_idas Table_name, StatsName,a.stats_id,a.auto_created,a.user_created, as Stats_Column from sys.stats a 
INNER JOIN sys.stats_columns b on a.object_id=b.object_id and a.stats_id=b.stats_id 
INNER JOIN sys.columns c on b.object_id=c.object_id and b.column_id=c.column_id 
where a.object_id=object_id('SomeTableName')

-> Removing the where clause will display all statistics from all tables on the database.