Query for last date of index rebuild for all databases in a instance

sourav dutta 231 Reputation points
2022-06-20T12:53:59.23+00:00

Hello,

I can get all database wise last index rebuild date in sql server.

Thanks in advance.

Developer technologies | Transact-SQL
SQL Server | Other
{count} votes

Accepted answer
  1. Bert Zhou-msft 3,436 Reputation points
    2022-06-21T01:26:19.503+00:00

    Hi,@sourav dutta

    Welcome to Microsoft T-SQL Q&A Forum!

    All I can say is that it is uncontrollable that you want to get update statistics , rebuild will also update your index information , you can take a look at the index maintenance script written by Michelle Ufford, maybe it can help you.

    Best regards,
    Bert Zhou


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Tom Phillips 17,771 Reputation points
    2022-06-20T15:52:16.597+00:00

    That data does not exist at a database level. That would be a maintenance job. You could get it from the job history of your maintenance job.

    1 person found this answer helpful.
    0 comments No comments

  2. Olaf Helper 47,516 Reputation points
    2022-06-20T13:09:10.807+00:00

    SQL Server don't store (and knows) where an index was last rebuild or reorganized.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.