Production DBA
What to Do When the SQL Server Keeps Crashing
You’re facing a weird series of outages you’ve never faced before.
At unpredictable, seemingly random times, the SQL Server restarts, locks up, or just stops processing queries.
It’s been happening over the last month or two, and you can’t just ask “what changed?” because maybe nothing has changed, or maybe everything has changed, and you don’t want to play guessing games. Your managers and end users want the fastest possible route back to safety. Here’s what to do.
1. First, rule out corruption.
Open my corruption checklist and follow the first step of instructions to query msdb.dbo.suspect_pages. If any rows show up, you simply cannot trust the storage you’re using right now. SQL Server will report corrupt database pages, but if the database AND the operating system & SQL Server binaries live on the same underlying storage technology, the call is coming from inside the house. The OS and SQL binaries may already be corrupt, which can cause random restarts and failures. You have to get the hell out of there, not stick around to investigate like white people in horror movies.
If you’re seeing any corrupt pages, evacuate the databases to a freshly installed OS & SQL Server on completely different underlying storage. I don’t mean different volumes in the same pool of disks on the same buggy shared storage – I mean different storage. I wouldn’t even trust OS & SQL images that you’ve downloaded & stored on that buggy storage.
You’re still going to have to work through the rest of that corruption checklist, though, because the existing corruption inside the user databases will follow you over to the new server. At least once you’ve evacuated to the new storage, you can focus on fixing the user database corruption rather than troubleshooting random crashes due to OS & SQL binary corruption.
2. Rule out poison waits.
After the server’s been up for a day or two, run a health check with sp_Blitz and look for lines that warn about poison waits on RESOURCE_SEMAPHORE or THREADPOOL. If you have those, SQL Server is running out of a finite resource. It’s a good-news-bad-news situation: the good news is that you can probably fix it quickly without spending money. The bad news is that fixing those is beyond what I can explain quickly in a blog post, so I’ve linked you to training resources.
You can do steps 1 & 2 without waiting for the next outage. You can get started on them right now. If you do both of those, and they both pass cleanly (no corruption and no poison wait warnings), then I’m going to describe several different tracks that can all start in parallel.
We don’t have to wait for the next outage – keep working down through this post!
Track A: Get ready to use the DAC.
In preparation for the next outage, we wanna be ready to connect to the Dedicated Admin Connection (DAC) to again rule out those poison waits. Now – not when the server’s already down – test that you can connect to the DAC, and write out the scripts you’re going to use if the DAC does respond during the emergency. If the DAC does respond and allow connections, that’s a classic sign that you’re facing one of the poison waits above.
Track B: Open a Microsoft support case.
Open a support case with Microsoft in a parallel track to the rest of the work in this post. I don’t expect Microsoft to find the root cause right away – cases like this are often complex – but I want to get that process started because the first level or two or six of Microsoft support aren’t exactly the sharpest knives in the drawer. They’re going to ask questions like “Are any red lights on?” and “Have you restarted Access?” and we wanna get those out of the way while we continue working down through this list.
You may very well be hitting a known bug that they haven’t fixed publicly yet. The list of fixes in modern cumulative updates (example: 2025 CU11) are genuinely staggering, and sometimes these fixes are baking behind the scenes for months before they’re deemed safe for public consumption. If MS Support recognizes that you’re facing a known issue, you might be eligible to get access to the fix much more quickly, before it ships as a public Cumulative Update.
Track C, Step 1: If you’re not using Availability Groups yet, it’s time to start.
I really hate adding complexity into a situation like this, but when you’re facing random crashes that are unacceptable to the business, getting lower unplanned downtime means making some planned changes.
Normally, Availability Groups involve adding a new network name (the listener), and reconfiguring your apps to point to that listener instead of a server’s name. Pro tip: if you’re using SQL Server Enterprise Edition, here’s a better way to do it that involves just a little bit of one-time downtime in order to get more seamless failovers:
- Rename the old database server as MyServerName_Old
- Configure the AG, and use MyServerName as the listener name
- Apps that point to MyServerName will now automatically point to the AG listener, which can move around from replica to replica, without being reconfigured
Now, that’s a short term emergency quick fix to get AGs into place. Long term, you’ll want to more properly configure the apps, like deciding whether to use MultiSubnetFailover=True in the connection string. For now, though, you’re fine.
Track C, Step 2: Add in a meaningfully different replica.
Whether you already had AGs in place, or whether you’re adding them for the first time, you want a new standby replica (either sync or async) that is meaningfully different from the current busted primary, or any of its existing replicas. I just don’t trust ’em right now, and I don’t have the time to do root cause analysis across a scattered herd of suspicious characters.
If your current replicas are on the latest Cumulative Update, the new replica should be 1-2 CUs behind – or if the current replicas are a few CUs behind, the new one should be on the latest CU.
If your current replicas have a laundry list of trace flags and weird sp_configure switches set, the new replica should not.
If your current replicas are on an ancient version of Windows, the new replica should be the current version of Windows.
If your current replicas are VMs, the new replica should be a physical box. If your current replicas are physical boxes, the new replica should be from a different vendor, or a VM. If you’re in the cloud, use a different instance family, and use a different starting point image – ideally, the cloud vendor’s default blank template for Windows, not a customized company one.
But most meaningfully, don’t install anything extra on it. Keep the replica as close as possible to the default installation of Windows and SQL Server. Don’t use some corporate template with 13 different apps and utilities installed on it from 4 different IT teams. We’re trying to rapidly establish a safe home for this SQL Server, and we don’t have the time to test exactly which of the bizarro non-defaults is causing the issue. Get to a safe place, fast.
The next time you have an outage, fail over to this new meaningfully different replica. If that solves our random outages, we still don’t have a root cause – but honestly, I may not have enough staff power to get to a true root cause. Build a new set of replicas that match this new safe place, and if that’s good enough for the business, our work stops here.
Track D: Simplify the database settings.
I’mma be honest, dear reader: you’re probably gonna do Track D before you do Track C. However, if I didn’t describe Track D to you first, and have you recoil in horror at the political complexity, then you’d probably be hesitant to do what I’m about to describe here.
Start turning stuff off.
I know, when you first moved to newer versions of SQL Server, you were really excited to flip switches to turn on stuff like Query Store, automatic tuning, accelerated plan forcing, etc, but let’s get back to the simplest possible configuration to rule out the possibility that we’re hitting feature interoperability bugs.
Run sp_Blitz and go through the non-default configuration options. Anything that’s been switched on or changed from the defaults, change it back.
Track E: Get help from someone who’s seen it.
Schedule a free sales call with me, and as a part of that, you’ll get instructions on how to send me your server’s diagnostic data. I can take a quick look at it, and sometimes, it’s something I can recognize right away, and tell you if I’m a good fit or give you a few pointers on where to go next.
I can’t usually solve it for you as part of the free sales call – after all, if it was that easy, you wouldn’t need me – but as you review the work involved in the above steps, it’ll start to make sense as to why you’d get professional help involved faster to get you to a root cause more quickly.
Hope that helps!
Free, 3× a week
Get my new posts by email
Three posts a week, plus a Monday roundup of the best database news from around the web.