Skip to content

Instantly share code, notes, and snippets.

@petesql
Last active September 3, 2017 10:53
Show Gist options
  • Save petesql/8b9d3a7d8e836b709a6dd4dafb095a7e to your computer and use it in GitHub Desktop.
Save petesql/8b9d3a7d8e836b709a6dd4dafb095a7e to your computer and use it in GitHub Desktop.
SELECT sdb.Name AS DatabaseName,
COALESCE(CONVERT(VARCHAR(12), MAX(bus.backup_finish_date), 101),'-') AS LastBackUpTime
FROM sys.sysdatabases sdb
LEFT OUTER JOIN msdb.dbo.backupset bus ON bus.database_name = sdb.name
GROUP BY sdb.Name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment