Find the last time table was updated

后端 未结 6 934
渐次进展
渐次进展 2020-12-23 12:10

I want to retrieve the last time table was updated(insert,delete,update).

I tried this query.

SELECT last_user_update
FROM sys.dm_db_index_usage_stat         


        
6条回答
  •  别那么骄傲
    2020-12-23 12:46

    If you want to see data updates you could use this technique with required permissions:

    SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseName, last_user_update,*
    FROM sys.dm_db_index_usage_stats
    WHERE database_id = DB_ID( 'DATABASE')
    AND OBJECT_ID=OBJECT_ID('TABLE')
    

提交回复
热议问题