SQL SERVER – Finding Last Backup Time for All Database

Here is the quick script I use find last backup time for all the databases in my server instance.

SQL SERVER - Finding Last Backup Time for All Database backupsqlserver

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

The query above will return following result where we can see the database last database backup date and time.

SQL SERVER - Finding Last Backup Time for All Database backupsqlserver1

Do you use any other script for the same purpose, please share here, it will be interesting for all of us know.

Here are few other blog posts which are related to this subject.

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL Backup, SQL DMV, SQL Scripts, SQL Server
Previous Post
SQL SERVER – Fix: Error: MS Jet OLEDB 4.0 cannot be used for distributed queries because the provider is used to run in apartment mode.
Next Post
SQLAuthority News – Happy Deepavali and Happy News Year

Related Posts

Leave a Reply