Skip to content

SQLpathy

Share…Learn…Grow !!!

  • Mind Maps
  • Security
  • About

Category: Meta-Data

When was last statistics updated?

On August 2, 2018 By sqlpathyIn Meta-Data, SQL ServerLeave a comment

Here is the handy query that I use to find out last statistics update date for objects. Key to find statistics update date is function STATS_DATE which takes two arguments – object_id (id of table/indexed view) and stats_id (id of statistics object)

SELECT object_name(object_id) table_name
	,name index_name
	,CASE
		WHEN (is_unique | is_unique_constraint) = 1
			THEN 'UNIQUE-' + type_desc
		ELSE 'NON-UNIQUE-' + type_desc
		END type_desc
	,stats_date(object_id, index_id) last_stats_update_date
FROM sys.indexes ind
WHERE EXISTS (
		SELECT 1
		FROM sys.objects
		WHERE type = 'U'
			AND object_id = ind.object_id
		);

Further Reading:
STATS_DATE

Recent Posts

  • What is Code Signing?
  • Merry Christmas!!!
  • Mind Map: Database Engine

SQLPathy Efficacy

  • 82,300 people find it helpful!

Enter your email address to follow SQLPathy and receive notifications of new posts by email.

Join 25 other subscribers

Calendar

January 2026
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Apr    

SQLPathy@Twitter

Tweets by sqlpathy

Blogs I Follow

  • NYC
  • bhaktishashtri
  • SQL with Manoj
  • sqlsunday.com
  • SQL Studies
  • Databases - Infrastructure - Security
  • Code Wala
  • Paul Hernandez playing with Data
  • SQL Authority with Pinal Dave

Categories

  • DDL inside transaction
  • Documentation
  • Extended Properties
  • Legacy Applications
  • Logon Trigger
  • Meta-Data
  • Mind Map
  • Performance Tuning
  • Replication
    • Transactional Replication
  • SQL Server
  • SQL Server 2012
    • Database Upgrade
  • SQL Server 2014
  • SQL Server 2019
  • SQL Server agent
  • SQL Server Job
  • SQL Server Security
  • T-SQL
    • lock
    • tablockx
  • Transaction
  • Truncate
  • Uncategorized

Top Posts & Pages

  • What is Code Signing?
  • Merry Christmas!!!
  • Mind Map: Database Engine

Social Profiles

Follow Us

Create a free website or blog at WordPress.com.
NYC

NYC

bhaktishashtri

SQL with Manoj

SQL Server, SQL Queries, DB concepts, Azure, Spark SQL, Tips & Tricks with >500 articles !!!

sqlsunday.com

T-SQL tips and tricks, best practices and query plans from the field.

SQL Studies

 Live, Learn, Share

Databases - Infrastructure - Security

By K. Brian Kelley

Code Wala

Designing and coding

Paul Hernandez playing with Data

Business Intelligence, Data Analysis, Advanced Analytics and more ...

SQL Authority with Pinal Dave

SQL Server Performance Tuning Expert

  • Subscribe Subscribed
    • SQLpathy
    • Join 25 other subscribers
    • Already have a WordPress.com account? Log in now.
  • Privacy
    • SQLpathy
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
Design a site like this with WordPress.com
Get started