Get last backup dates for all databases
WITH LastBackupTaken AS (
SELECT database_name,
backup_finish_date,
RowNumber = ROW_NUMBER() OVER (PARTITION BY database_name
ORDER BY backup_finish_date DESC)
FROM msdb.dbo.backupset
)
SELECT database_name,database_name FROM LastBackupTaken
WHERE RowNumber = 1
No comments:
Post a Comment