Created
January 27, 2015 16:38
-
-
Save veysby/4f18e99d206121ee33a6 to your computer and use it in GitHub Desktop.
MSSQL: list statistics update date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
SCHEMA_NAME(schema_id) AS SchemaName, | |
OBJECT_NAME(o.object_id) AS ObjectName, | |
type AS ObjectType, | |
s.name AS StatsName, | |
STATS_DATE(o.object_id, stats_id) AS StatsDate | |
FROM sys.stats s | |
INNER JOIN sys.objects o ON o.object_id=s.object_id | |
WHERE OBJECTPROPERTY(o.object_id, N'ISMSShipped') = 0 | |
AND LEFT(s.Name, 4) != '_WA_' | |
ORDER BY | |
ObjectType, SchemaName, ObjectName, StatsName; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment