Find the last time table was updated

后端 未结 6 936
渐次进展
渐次进展 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:45

    SELECT so.name,so.modify_date
    
    FROM sys.objects as so
    
    INNER JOIN INFORMATION_SCHEMA.TABLES as ist
    
    ON ist.TABLE_NAME=so.name where ist.TABLE_TYPE='BASE TABLE' AND 
    
    TABLE_CATALOG='DbName' order by so.modify_date desc;
    

    this is help to get table modify with table name

提交回复
热议问题