When was my table last scaned or updated? | SansSQL

Tuesday, November 18, 2008

When was my table last scaned or updated?

USE DatabaseName
GO

SELECT
         t.name,
         i.last_user_lookup,
         i.last_user_scan,
         i.last_user_seek,
         i.last_user_update
FROM sys.dm_db_index_usage_stats i
         INNER JOIN sys.tables t
         ON i.object_id = t.object_id
WHERE
         database_id = db_id( 'DatabaseName' )

1 comment:

Firthose said...

Thanks.

Post a Comment