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'
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