获取数据表最后最后访问,修改,更新,扫描时间
程序员文章站
2022-04-16 09:19:15
数据分析,需要获取数据每一张表的最后访问,修改,更新,扫描时间等: 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的Date以及Format格式化