Get last data change of table (including deletes)

Will probably not work on heap (non clustered) tables

select object_name(s.object_id) as TableName, 
       i.name                   as IndexName, 
       last_user_update 
--,s.* 
from   sys.dm_db_index_usage_stats s 
       join sys.indexes i 
         on i.index_id = s.index_id 
            and i.object_id = s.object_id 
where  object_name(s.object_id) = 'myTable' 

Comments

Popular posts from this blog

How to decrypt stored password from SSMS registered servers

How to fail sql server agent job if powershell script fails

Cause for Parameter is incorrect 0x80070057 error in ssis