Tag Archives: Modified Tables in Last few Days

How to get All the Tables which are Modified in last few days in Sql Server?

We can write a query like below to get the all the Tables which are modified using an ALTER statement in last 10 days. A Table is also considered as modified when an Index on the table is Created or Altered.

SELECT name 'Table',modify_date 'Last Modified Date'
FROM sys.tables 
WHERE  DATEDIFF(D,modify_date, GETDATE()) < 10 

Note: If a table is never altered after it’s creation then modify_date column value in the sys.objects will be it’s creation date.