Created
June 8, 2015 01:00
-
-
Save martin9700/9ac5b4dd00a9e47096df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT bk.database_name AS Name, | |
bk.recovery_model AS RecoveryModel, | |
bk.backup_finish_date AS LastBackupDate, | |
bk.Type, | |
bk.backup_size AS LastBackupSize | |
FROM msdb.dbo.backupset AS bk | |
INNER JOIN ( | |
SELECT database_name, | |
MAX(backup_finish_date) AS LastBackupDate, | |
Type | |
FROM msdb.dbo.backupset | |
GROUP BY database_name,Type | |
) AS bkmax | |
ON bk.database_name = bkmax.database_name and | |
bk.backup_finish_date = bkmax.LastBackupDate and | |
bk.type = bkmax.type |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment