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

Advertisement

Recent Posts

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

SQLPathy Efficacy

  • 81,736 people find it helpful!

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

Join 37 other subscribers

Calendar

March 2023
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  
« Apr    

SQLPathy@Twitter

  • “Code Signing” is a method which helps validate both authenticity and Integrity! A signed code is authentic as it v… twitter.com/i/web/status/1… 3 years ago
  • Merry Christmas!!! sqlpathy.com/2018/12/26/mer… https://t.co/tbFUfJMFHd 4 years ago
Follow @sqlpathy

Blogs I Follow

  • 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

Blog at WordPress.com.
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

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • SQLpathy
    • Join 25 other followers
    • Already have a WordPress.com account? Log in now.
    • SQLpathy
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar