Last DB Restore

A very handy SQL Script to check the last time database was restored.
This comes handy when you are trying to figure out when was the last database backup for was done so you can plan on the last backup file to restore from.

--Last Database Restore for a specific database

SELECT

   [rs].[destination_database_name],

   [rs].[restore_date],

   [bs].[backup_start_date],

   [bs].[backup_finish_date],

   [bs].[database_name] as [source_database_name],

   [bmf].[physical_device_name] as [backup_file_used_for_restore]

FROM msdb..restorehistory rs

INNER JOIN msdb..backupset bs ON [rs].[backup_set_id] = [bs].[backup_set_id]

INNER JOIN msdb..backupmediafamily bmf ON [bs].[media_set_id] = [bmf].[media_set_id]

where [rs].[destination_database_name] = '[db_name]'

ORDER BY [rs].[restore_date] DESC