Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 4729

Get the list of table's last Inserted/Updated date from a database

$
0
0

Hi All,

Good afternoon!

Please help me to find the last inserted/updated date from different tables in a database.

Consider I have a database called testDB, which contains 20 tables. Most of these tables will get data inserted/updated daily. But sometimes it may not happen due to some issues . We will not be knowing about this issue until we check  in each table manually. Now, somebody should be daily checking for the issues in this db. So, we have decided to make an alert mail to send this informations to us.

We need to check whether any of the table's in TetsDB has got inserted/updated data in one day difference.

I have tried this..

SELECT OBJECT_NAME(OBJECT_ID) AS Object_, last_user_update,*
FROM sys.dm_db_index_usage_stats
WHERE database_id = DB_ID( 'TestDB')


Thanks,

Julie





Viewing all articles
Browse latest Browse all 4729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>