SQL Server Backup History: Duration and Size Report
Apr 13, 2026 / · 6 min read · sql server backup recovery msdb sql scripts database administration backup monitoring maintenance scripts reporting sys.databases backupset ·Query Backup Duration and File Size from SQL Server History This script queries SQL Server's msdb backup history to report the backup type, start and finish time, duration in minutes, and file size in both megabytes and gigabytes for every backup across all user databases on the server. Purpose and Overview Knowing …
Read MoreSQL Server Backup Status Report: All Databases
Check SQL Server Backup Age Across All Databases This script queries the SQL Server backup history catalog to report the most recent full, differential, and transaction log backup for every database, including how many hours and minutes ago each backup completed. Purpose and Overview Database backups are your last line …
Read MoreSQL Server Point-in-Time Restore with STOPAT
Apr 5, 2026 / · 8 min read · sql server restore backup recovery transaction log msdb database maintenance DBA scripts point in time restore sys.databases ·Recover a SQL Server Database to a Specific Point in Time SQL Server's RESTORE LOG ... WITH STOPAT lets you roll a database back to any exact moment covered by your backup chain. This guide walks through querying backup history in msdb, executing the restore sequence, and verifying the result. Purpose and Overview Data …
Read MoreSQL Server Database Size Report for All Databases
Apr 2, 2026 / · 6 min read · sql server monitoring sql scripts sys.master_files sys.databases database administration capacity planning storage reporting maintenance scripts ·Report Database Size in MB and GB for All SQL Server Databases This script queries sys.master_files and sys.databases to report the total allocated size in megabytes and gigabytes for every user database on the SQL Server instance, sorted by largest database first. Purpose and Overview Knowing how large each database …
Read MoreSQL Server Blocking Detection: Find Blocked Sessions
Blocking in SQL Server occurs when one session holds a lock that another session needs, causing the second session to wait. This T-SQL script queries the dynamic management views to show all currently blocked sessions, the blocking session, wait type, wait duration, and the SQL text involved. Purpose and Overview When …
Read MoreGenerate DBCC SHOWCONTIG Commands for All SQL Server Tables
Generate DBCC SHOWCONTIG Commands for All User Tables in SQL Server Database administrators frequently need to monitor table and index fragmentation to maintain optimal database performance. This SQL Server script provides an efficient way to generate DBCC SHOWCONTIG commands for all user tables in your database …
Read More