How to Check the Last Database and Transaction Log Backup in SQL Server

To check the latest database and transaction log backup in SQL Server, use SQL Server Management Studio (SSMS) or query the backup history in msdb.

Using SQL Server Management Studio

Connect to the SQL Server instance, expand Databases, right-click the required database and select Properties. Review the backup dates on the General page. The layout varies by SSMS version.

SQL Server database properties showing backup information (historical screenshot)

Using T-SQL

The following read-only query summarizes the most recent recorded full, differential and transaction log backup for each database in the instance. Run it with authorized access to the msdb backup history.

SELECT database_name,
       MAX(CASE WHEN type = 'D' THEN backup_finish_date END) AS last_full_backup,
       MAX(CASE WHEN type = 'I' THEN backup_finish_date END) AS last_differential_backup,
       MAX(CASE WHEN type = 'L' THEN backup_finish_date END) AS last_log_backup
FROM msdb.dbo.backupset
GROUP BY database_name
ORDER BY database_name;

This shows recorded backup history, including copy-only backups of the applicable type. Missing history can result from retention cleanup or backups being taken on another instance. A recorded backup timestamp is not proof of recoverability; check the backup files or media and perform approved restore testing.

Reference

Microsoft Learn: backupset (Transact-SQL)

You May Also Like

Leave a Reply?