Statistics in SQL Server refers specifically to information that the server collects about the distribution of data in columns and indexes. More information about Statistics on How to Create, Drop and update Statistics are covered here.
In this post, we will see how to retrieve the information on when a Statistics was last updated.
To retrieve this information, run the below query on one of the database.
SELECT OBJECT_NAME(OBJECT_ID) AS TableName, name AS IndexName, Type_desc AS IndexType, TableType=Case When OBJECTPROPERTY(OBJECT_ID,'IsUserTable')=0 Then 'SystemTable' When OBJECTPROPERTY(OBJECT_ID,'IsUserTable')=1 Then 'UserTable' END, STATS_DATE(OBJECT_ID, index_id) AS StatsUpdatedDate
FROM sys.indexes
Where OBJECTPROPERTY(OBJECT_ID,'IsUserTable')=1
Order by TableName
This query will list the indexes present on all of the user tables in a particular database and when their Statistics was last updated.
2 comments:
Another option is to use the sp_autostats. This will give the stats last updated date.
Aivivu đại lý vé máy bay, tham khảo
vé máy bay đi Mỹ Vietnam Airline
lịch bay từ mỹ về việt nam
mua ve may bay gia re tu duc ve viet nam
bao giờ có chuyến bay từ nga về việt nam
ve may bay tu anh ve viet nam
chuyến bay từ pháp về việt nam hôm nay
khách sạn cách ly tphcm
chuyến bay dành cho chuyên gia
Post a Comment