Keep SQL Server logs readable by recycling the error log weekly, retaining enough archives, setting a size cap, and checking history.
Checking Certificates That Expire Soon in Every Database
Nobody remembers who created that certificate. Here is a short loop that lists every certificate expiring soon, and what to ask about each one.
Window Functions Over GROUP BY Results: SUM of SUM Explained
Why does SUM(SUM(Amount)) OVER () work? Because the window runs after GROUP BY. A short demo with shares, ranks and a filter trap.
Ordering a Maintenance Window: Backups, CHECKDB and Index Work
Order a maintenance window by listing Agent schedules, separating CHECKDB, backups, index work, and statistics, then tracking growth.
Find SQL Server Agent Job Failures Before Users Do
Agent job failures hide in msdb until someone reads the history. This post builds three demo jobs, then finds the failed step and its message, the job that runs too long, the job that never starts, and the jobs that notify nobody.
Walking Foreign Key Chains to Find a Safe Delete Order
Map foreign key chains from a parent table with a recursive catalog query, then list deepest children first and flag cascade rules.
SQL SERVER – Function to Round Up Time to Nearest Minute Interval
A small T-SQL function that rounds a datetime up or down to the nearest minute interval you pass in, with the code and how to call it.







