Category: Backups & Recovery
-
How to Back Up a Database in SQL Server
A full backup in T-SQL and SSMS with the options worth typing every time: CHECKSUM, COMPRESSION, INIT and COPY_ONLY, ZSTD on SQL Server 2025, then RESTORE VERIFYONLY and msdb to prove it.
Written by
-
SQL Server Differential vs Log Backup: Which One Restores What, and How the Chain Breaks
Mid restore is the wrong moment to work out how differential and log backups differ. What each one contains, which files you actually need, and the trap that any ordinary full backup taken by anyone silently becomes the new base for your differentials.
Written by
-
DBA Scripts: Get Backup Size Trend
What Your Backup Sizes Are Quietly Telling You The backup drive is filling faster than planned, or a full backup suddenly ran long, and you need to know which database grew and when. This rolls msdb backup history up to one row per database, per backup type, per month, so the change shows in a…
Written by
-
DBA Scripts: Get Last Restore History
A Backup You’ve Never Restored Is a Guess, Not a Plan Every DBA can point to a backup schedule. Far fewer can point to proof that any of those backups actually restore. A backup job finishing green tells you the file was written, not that it’s usable, not that the process works end to end,…
Written by
-
DBA Scripts: Generate Backup and Restore Scripts
Stop Hand-Typing Database Names Into Backup Commands Writing a one-off BACKUP DATABASE or RESTORE DATABASE command for a single database is trivial. Doing it correctly for every database on an instance, with a consistent naming convention, the right options, and none typed by hand, is where mistakes creep in: a missed database, a typo in…
Written by
-
DBA Scripts: Backups and Recovery
Backup and recovery is the one area of SQL Server administration where “probably fine” isn’t good enough, a backup you haven’t verified restores is a belief, not a backup. Twelve scripts across this site cover the whole lifecycle: what recovery model each database should be in, whether backups are actually happening on schedule, whether they’re…
Written by
-
DBA Scripts: Get Recovery Model Audit
The Mismatch That Fills a Disk A database’s recovery model is a promise about what kind of restore is possible, FULL and BULK_LOGGED promise point-in-time recovery, backed by log backups; SIMPLE promises none, and truncates the log on its own. The incident happens when reality doesn’t match the promise: a FULL-recovery database with no log…
Written by
-
DBA Scripts: Get Database Health
Before diving into anything deeper, a health check should start with the basics: is every database actually online, is the recovery model what it’s supposed to be, and is anything quietly stuck waiting for a log backup it isn’t getting. None of these are exotic checks, but they’re exactly the kind of thing that goes…
Written by
-
DBA Scripts: Get Database Backup History
Most backup checks answer one question: what’s the latest backup. That’s the right question most of the time, but it hides everything that happened before it. A backup job that ran reliably for a year and then quietly changed behaviour 3 weeks ago still passes a “latest backup is recent” check. This script skips the…
Written by
-
DBA Scripts: Get Backup Restore Progress
A large restore has been running for 20 minutes. Is it about to finish, or is it barely a quarter done? SSMS won’t tell you unless you started it interactively and left that session open, and a restore kicked off from a script, a job, or someone else’s session gives you nothing to watch by…
Written by
- Tune a Slow Query With Copilot in SSMS
- xp_readerrorlog: Read the SQL Server Error Log with T-SQL
- Cannot Drop Database Because It Is Currently in Use (Error 3702)
- Could Not Drop Login Because the User Is Currently Logged In (Error 15434)
- Set a Maximum Database File Size in SQL Server (MAXSIZE)
- SQL Server Activity Monitor in SSMS (and the Performance Dashboard)
- Backups & Recovery (18)
- DBA Scripts (154)
- High Availability (HA) (13)
- Installation & Configuration (60)
- Maintenance (25)
- Migration & Upgrades (14)
- Monitoring (10)
- Performance Tuning (38)
- Security (Encryption & Permissions) (25)
- Storage & Capacity (18)
- T-SQL Fundamentals (17)
- Troubleshooting (108)
- Wait Types (236)