简体   繁体   English

如何获取具有更新值的表的列表

[英]How to get a list of tables that has updated values

.Hi everyone, I need a little help on coming up with a query that lists all tables whose data was updated from a certain date to present. 大家好,我需要一些帮助来提出一个查询,该查询列出了从某个日期到现在数据已更新的所有表。

I'm using SQL Server 2012. 我正在使用SQL Server 2012。

TIA! TIA!

Addt'l info: 附加信息:

This is the query that I have so far: 这是我到目前为止的查询:

Select distinct OBJECT_NAME(object_id) As TableName
From sys.dm_db_index_usage_stats
Where user_updates > 0
And last_user_update > cast('07/17/2012' as datetime)
order by TableName

I wanted to get all the tables that had its data updated or new data inserted from 07/17/2012 to present. 我想获取从2012年7月17日至今已更新其数据或插入新数据的所有表。

I haven't done a ton of work with SQL Server since leaving my last DBA job several years ago, instead I focus more on MySQL but I had to do something similar back then and found this article helpful. 自从几年前离开我的上一个DBA工作以来,我没有做大量的SQL Server工作,相反,我更加专注于MySQL,但是那时我不得不做类似的事情,发现这篇文章很有帮助。 Hopefully it sheds some light... 希望它能阐明一些...

http://blog.sqlauthority.com/2009/05/09/sql-server-find-last-date-time-updated-for-any-table/ http://blog.sqlauthority.com/2009/05/09/sql-server-find-last-date-time-updated-for-any-table/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM