How to check the Database Backup State in SQL Server?

Опубликовано: 02 Июль 2026
на канале: Let's Learn
2,657
45

If you're looking for a SQL tutorial for beginners with examples, this tutorial is a great way to learn SQL basics. Just follow through and you'll be able to write SQL queries. In this video we will learn about the joins. The video gives you an overview about the database backup process and how you can check the latest backups and backup which are already in progress.
@Letuslearnindia

******Check out below queries**********
______________________________________________
** Query to check the database backup in progress
______________________________________________

SELECT session_id as SPID, command, a.text AS Query, start_time, percent_complete, dateadd(second,estimated_completion_time/1000, getdate()) as estimated_completion_time
FROM sys.dm_exec_requests r CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) a
WHERE r.command in ('BACKUP DATABASE','RESTORE DATABASE')
______________________________________________
** Query to check most Recent Database Backup for Each Database
______________________________________________

SELECT
CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS Server,
msdb.dbo.backupset.database_name,
MAX(msdb.dbo.backupset.backup_finish_date) AS last_db_backup_date
FROM msdb.dbo.backupmediafamily
INNER JOIN msdb.dbo.backupset ON msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id
WHERE msdb..backupset.type = 'D'
GROUP BY
msdb.dbo.backupset.database_name
ORDER BY
msdb.dbo.backupset.database_name
_________________________________________________
◆For more videos related to SQL and other languages, please subscribe to my channel "Let's Learn".
_________________________________________________
◆ Subscribe to our channel -    / letslearn-in  
_________________________________________________
◆To Learn more, check out the Playlists -
_________________________________________________
◆ SQL Tutorial Playlist -
https://www.youtube.com/watch?v=0i991...
_________________________________________________
◆ YouTube Channel -    / letslearn-in  
_________________________________________________
◆ CATIA Playlist:
https://www.youtube.com/watch?v=VgBcF...
_________________________________________________
◆You can follow us on Facebook:
www.facebook.com/letuslearnindia
_________________________________________________
◆You can follow me on Twitter:
www.twitter.com/ismails_007

◆You can follow me on Instagram:
www.instagram.com/letuslearnindia
_________________________________________________
#SQL #DatabaseBackup #SQLServer