MSSQL Find Last Date & Time Database Table Accessed

This is a T-SQL that will show all the last access date and time for Select, tables in a database.

select
t.name
,user_seeks
,user_scans
,user_lookups
,user_updates
,last_user_seek
,last_user_scan
,last_user_lookup
,last_user_update
from
sys.dm_db_index_usage_stats i JOIN
sys.tables t ON (t.object_id = i.object_id)
where
database_id = db_id()

Source: SQL Authority

Additional Information/Links:  SQL Blog

 

2 Replies to “MSSQL Find Last Date & Time Database Table Accessed”

  1. Mohamed Udhuman 2014-06-09 at 1:48 am

    Wow, Very nice Script Hero

    Reply

    1. Rich Kreider 2014-06-09 at 3:29 pm

      Thanks, Mohamed. The credit definitely goes to SQL Blog for this script!

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *