Tag: SQL Database restore

T-SQL script to get last restored date of SQL Server Database 0 (0)

Below query can be used to find out database last restored date.

SELECT [bs].[database_name] as [source_database_name]
[bmf].[physical_device_name] as [Backup_file_used],
[rh].[user_name] AS [RestoredBy],
datediff(minute,bs.backup_start_date,bs.backup_finish_date) as RestoreDurationMin,
CAST(bs.backup_size/1024.0/1024 AS DECIMAL(10, 2)) AS BackupSizeMB
FROM msdb..restorehistory rh
INNER JOIN msdb..backupset bs
Read the rest

© 2024

Theme by Anders NorĂ©nUp ↑