Saturday, January 15, 2011

How to get SQL Server Restore history using T-SQL?

How to find SQL Server databases Restore History?
How to find Last Restore Date od SQL Server database?

Few developers asked me how to find the last time a database was restored using T-SQL. I have formed the following query using MSDB..RestoreHistory table.

SELECT *
FROM MSDB..RestoreHistory WITH (nolock)
WHERE destination_database_name = 'DatabaseName'
ORDER BY restore_date DESC

1 comment:

  1. Best Power BI Course helps you master data visualization, reporting, and business intelligence. It’s perfect for professionals who want to turn raw data into meaningful insights

    ReplyDelete