获取数据表最后最后访问,修改,更新,扫描时间
程序员文章站
2022-09-04 13:13:50
数据分析,需要获取数据每一张表的最后访问,修改,更新,扫描时间等: SELECT [Table Name] = [name],[Create Date] = create_date,[Modify Date] = modify_date,[Last User Update] = last_user_ ......
数据分析,需要获取数据每一张表的最后访问,修改,更新,扫描时间等:
select [table name] = [name],[create date] = create_date,[modify date] = modify_date,[last user update] = last_user_update,[last user scan] = last_user_scan from sys.tables as t inner join (select [tablename] = object_name(object_id),last_user_update, last_user_scan from sys.dm_db_index_usage_stats where database_id = db_id('test')) as sd on (t.[name] = sd.[tablename]) go
上一篇: Java 实战范例之进销存管理系统的实现