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

SSIS: Set parent package variable from child package

How to decrypt stored password from SSMS registered servers

Insert bulk statement does not support recompile (SQL 2017)