Audit date of last SQL backup

Deepak over at SQLKnowledge wrote a very simple SQL query that will let you know when the last date of a backup was completed for all databases within a server.

SELECT as database_name, ISNULL(STR(ABS(DATEDIFF(day, GetDate(), MAX(backup_finish_date)))), ‘NEVER’) as DaysSinceLastBackup,ISNULL(Convert(char(10), MAX(backup_finish_date), 101), ‘NEVER’) as LastBackupDate
FROM master.dbo.sysdatabases B LEFT OUTER JOIN msdb.dbo.backupset A
ON A.database_name = AND A.type = ‘D’ GROUP BY ORDER BY


About noneil
Rapper turned Rockstar!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: