Today we will see a very interesting SQL SERVER Challenge about Cumulative Total Calculation. During a recent Comprehensive Database Performance Health Check.
sp_delete_database_backuphistory: Prune msdb Backup History
The sp_delete_database_backuphistory procedure removes the backup and restore history of one database from msdb, and sp_delete_backuphistory does it by age. The demo counts the rows of a database before and after the delete and previews the delete by age. The last sections explain how to keep the history small.
Finding Permissions Granted Directly to Users Instead of Roles
Find permissions granted directly to users, generate role-based review statements, and preserve DENY, column, and grant-option distinctions.
Agent Job Step Retries: Retry Attempts and Retry Interval
Configure Agent retry attempts and minute intervals, inspect retry history, and distinguish transient failures from unsafe replays.
Heartbeat Gaps: Finding Missing Check-Ins With LAG
Detect missing check-ins with LAG, report closed heartbeat gaps, and find silent or never-seen sources using an explicit UTC tolerance.
Database File Latency: Read and Write Stalls per IO
Database file latency is the stall time per read or write. This post divides the IO stall columns by the call counts for every file, explains the zero queued columns and says when a number is worth acting on.
ALTER AUTHORIZATION on a Database: Find and Change the Owner
ALTER AUTHORIZATION on a database changes its owner, and SUSER_SNAME(owner_sid) finds the current one. This post shows why a login that owns a database cannot be dropped and how to catch an orphaned owner.







