Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Find which Indexes were rebuild yesterday

Author  Topic 

rohaandba
Starting Member

33 Posts

Posted - 2012-05-04 : 14:22:18
My co DBA has done Index Rebuild Yesterday on a Datbase.
He is out today
Is there any way I can find which tables or indexes got rebuild yesterday

Thanking You

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-05-04 : 14:52:05
Try this:
select * from sys.dm_db_index_usage_stats 
where last_system_update>=DATEADD(day,DATEDIFF(day,0,GETDATE())-1,0)
You can add additional WHERE conditions for database_id, etc.
Go to Top of Page

rohaandba
Starting Member

33 Posts

Posted - 2012-05-04 : 15:08:29
Thnank You.

quote:
Originally posted by robvolk

Try this:
select * from sys.dm_db_index_usage_stats 
where last_system_update>=DATEADD(day,DATEDIFF(day,0,GETDATE())-1,0)
You can add additional WHERE conditions for database_id, etc.


Go to Top of Page
   

- Advertisement -