Fix it now
An internal consistency check inside the engine returned false and SQL Server stopped rather than carry on against an assumption it knows is wrong. The detail is in the error log as 17066, naming the source file, line and assertion. Microsoft attributes assertions to four things: a product bug, corruption, an external module in the process, or hardware.
EXEC sp_readerrorlog 0, 1, N'Assertion';
SELECT SERVERPROPERTY('ProductVersion'), SERVERPROPERTY('ProductUpdateLevel'), SERVERPROPERTY('Edition');
SELECT * FROM sys.dm_os_loaded_modules WHERE company != 'Microsoft Corporation';
DBCC CHECKDB (N'MyDb') WITH NO_INFOMSGS, ALL_ERRORMSGS;
- Write down the assertion text, source file name and line number from the log. That triple identifies the defect; two failures sharing it are the same bug, two that differ are unrelated.
- Look in the instance LOG folder for a SQLDump00xx.mdmp written at the same timestamp. Its presence confirms the engine captured state.
- Check the results of the loaded-modules query. Anything from an antivirus, backup or auditing product in the SQL Server process is a documented cause in its own right, and patching will not move it. Run
fltmc filtersfrom a Command Prompt as well. - With CHECKDB clean and no third-party modules, search Microsoft’s fix lists for your major version using the assertion text, then test the latest cumulative update on a non-production instance.
sp_readerrorlog needs VIEW ANY ERROR LOG on SQL Server 2022 and later, or VIEW SERVER STATE on 2019 and earlier. If the first command fails, that is usually why.
If the assertion stops after patching, you are done. If it returns, or if CHECKDB found something, the next section explains which of the four causes you are actually looking at.
Why it happens
An assertion is a check the engine’s own developers compiled into the code to state something that must always be true at that point. When it turns out to be false, continuing would risk writing incorrect data, so the engine terminates the batch or the connection and records what it can. 3624 is what your application sees. 17066 is the entry in the error log that carries the detail, and Microsoft states the two are raised together.
17065 is a near neighbour worth telling apart. It carries the same assertion message but Microsoft attributes it to transient, timing-related conditions as well as to in-memory or on-disk corruption, and its documented first action is simply to rerun the statement. If the failure does not come back, it was timing. 3624 with 17066 repeating at the same file and line is the one that means something.
Microsoft names four causes, and the article you are reading exists mainly because most treatments of 3624 cover three of them. A product bug is the common case and a cumulative update is the fix. Corruption trips a check that is working correctly. Hardware, usually memory, produces assertions scattered across unrelated files and lines. The fourth is an external DLL or filter driver loaded into the SQL Server process, and it is the one that survives every round of patching because the defect is not in the product.
A defect already corrected in a later build
You have this one if The same assertion repeats at the same source file and line, CHECKDB is clean, and no third-party module is loaded.
- Record version, update level and edition from the SERVERPROPERTY query.
- Search Microsoft’s cumulative update fix lists for your major version using the assertion text.
- Reproduce on a test instance on the candidate build before scheduling production.
Cumulative updates are cumulative. You do not need the specific update containing the fix; the latest one for your version includes it.
An external module inside the SQL Server process
You have this one if sys.dm_os_loaded_modules returns something whose company is not Microsoft, or fltmc filters shows a filter driver from a security or backup product.
- Identify the product the module belongs to and check its vendor’s SQL Server exclusion guidance.
- Exclude the SQL Server data, log and dump directories and the sqlservr process from on-access scanning.
- Re-test after the module is out of the process, before assuming a patch is needed.
This is the cause that makes a team patch three times and conclude SQL Server is unreliable. Rule it out early; the query costs nothing.
Real corruption tripping a valid check
You have this one if CHECKDB reports errors on the same database, or 5243 appears in the log.
- Take a copy-only backup, then restore from the last known clean backup.
- Check the Windows System log for disk and controller errors around the first occurrence.
- Confirm PAGE_VERIFY is set to CHECKSUM on every database on the instance.
- Re-run CHECKDB before returning the database to users.
Hardware, most often memory
You have this one if Assertions at unrelated source files and lines, sometimes with unexplained access violations, and no single workload reproduces them.
- Look for WHEA-Logger entries and machine-check records in the Windows System log.
- Run the server vendor’s memory and system diagnostics in a maintenance window.
- If virtualised, check host health and whether memory is overcommitted.
- Move the instance to different hardware and see whether the assertions follow it.
Full reference
What each number in the log is telling you
| Error | Severity | Symbolic name | What it is |
|---|---|---|---|
| 3624 | 20 | SYS_ASSERTFAIL | The assertion failed. This is what the application sees |
| 17066 | 16 | SQLASSERT_ONLY | The log entry carrying file, line and assertion text. Raised together with 3624 |
| 17065 | – | SQLASSERT_BOTH | The same assertion form, attributed to timing as well as corruption. Rerun the statement first |
| 5243 | – | – | A structural inconsistency in an in-memory storage engine structure |
5243 is the one most often misread. Because it says inconsistency, it gets treated as a CHECKDB problem, and CHECKDB comes back clean. Microsoft describes it specifically as an in-memory structure, and its published user action begins with hardware diagnostics and with checking that write-caching is not enabled on the disk controller, before restoring from backup and only then running CHECKDB. If you see 5243 and a clean CHECKDB, look at the hardware rather than at the database.
Working the log without guessing
| Command | What it gives you |
|---|---|
EXEC sp_readerrorlog 0, 1, N'Assertion'; |
Assertion lines from the current error log. Parameters are log number, 1 for SQL Server, then up to two filter strings |
EXEC sp_readerrorlog 1, 1, N'Assertion'; |
The same from the previous log, for a failure that predates a restart |
SELECT * FROM sys.dm_os_loaded_modules WHERE company != 'Microsoft Corporation'; |
Third-party modules loaded into the SQL Server process |
fltmc filters |
Filter drivers on the machine. Run from an elevated Command Prompt |
SELECT SERVERPROPERTY('ProductUpdateLevel'); |
The cumulative update level, which is what a fix list is matched against |
Reading the pattern before you plan a change
| Pattern | What it points at |
|---|---|
| Same assertion, same file and line, reproducible with one workload | A product defect. Look for a cumulative update that lists it |
| Assorted assertions at different files and lines | Memory or storage. Check diagnostics and the Windows System log |
| 5243 alongside 3624, CHECKDB clean | Hardware and write-caching, not the database |
| Only under one feature, such as columnstore or a specific index type | That code path. Avoiding it buys time while you patch |
| Started immediately after a patch or version upgrade | A regression in that build. Check the fix list for a later update |
| Started after a security or backup agent was installed | The external module cause. Check loaded modules first |
When nothing matches a published fix
With the instance on the latest cumulative update, CHECKDB clean and no third-party modules in the process, Microsoft’s documented next step is to contact support with the error logs, the dump files, reproduction steps and the module and filter driver information you gathered. Have that material ready before you open the case; it is the difference between a fast diagnosis and a fortnight of round trips.
A cumulative update restarts the instance and cannot be cleanly uninstalled from every configuration. Take full backups, test on a non-production instance, and schedule a window rather than patching under pressure while the assertion is firing.
When the version is the problem
If you have identified the defect and there is no cumulative update for your major version, check the support position before concluding no fix exists. Where the version really has stopped receiving updates, the correction exists only in code you are not running, and an upgrade is the honest answer rather than a sales one. Test the application against the target version first, and look for a workaround that avoids the failing code path to carry you until the migration lands.
When a licence is the actual fix
An assertion on a version that no longer receives cumulative updates is one of the few SQL Server problems where a newer product genuinely is the fix, because the correction only exists in code you are not running. Check first whether an update exists for the version you own: if it does, patching costs nothing but a maintenance window and you should do that instead. Where it does not, note how the licensing works before you budget – SQL Server core licences are sold in two-core packs, with a minimum of four core licences per physical processor and a minimum of four per virtual machine, and hyper-threading does not change the count in a physical deployment. Arco supplies SQL Server 2025 Standard core licences and will work out the count your server actually needs, including whether an existing agreement already entitles you to the newer version.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
3624 |
A system assertion check has failed; the engine stopped the operation rather than continue. Severity 20 | Microsoft Learn |
17066 |
The error log entry carrying the source file, line and failed assertion. Raised together with 3624 | Microsoft Learn |
17065 |
The same assertion message form, attributed to transient timing conditions as well as to in-memory or on-disk corruption. Rerun the statement first | Microsoft Learn |
5243 |
A structural inconsistency detected in an in-memory storage engine structure; the documented response starts with hardware and write-caching | Microsoft Learn |
Confirm the fix worked
SELECT SERVERPROPERTY('ProductVersion'), SERVERPROPERTY('ProductUpdateLevel');reports the build you intended to reach.- The workload that triggered the failure runs to completion.
EXEC sp_readerrorlog 0, 1, N'Assertion';returns nothing since the restart.- No new SQLDump files have appeared in the instance LOG folder.
DBCC CHECKDBon the affected database completes with no errors reported.
Questions people ask about this
Do I have to buy a newer version to fix this?
Usually not. If a cumulative update exists for the version you already own, applying it costs nothing beyond the maintenance window. Buying becomes the answer only when your version has stopped receiving updates and the correction will never reach it.
Is it safe to keep running while I investigate?
It depends what fails. If one reporting query trips the assertion and everything else runs normally, you have time. If assertions appear during recovery, checkpoint or write operations, treat it as urgent and get a good backup off the server first.
Should I send the dump file to Microsoft?
If you have a support agreement, yes, and it is the fastest route when the assertion matches no published fix. Microsoft asks for the error logs, the dumps, reproduction steps and system information together. The dump contains database and memory contents, so treat it as sensitive and send it through the support channel rather than by email.
Can a query change work around it?
Sometimes. If the assertion only fires under one plan shape, one index type or one feature, rewriting the query or forcing a different plan can avoid the code path. Treat that as a stopgap, not a fix.
CHECKDB is clean and patching changed nothing. What now?
Check what else is loaded into the SQL Server process. Microsoft lists an external DLL or filter driver as a cause of assertions alongside bugs, corruption and hardware, and it is the one that survives patching. sys.dm_os_loaded_modules and fltmc filters will tell you in seconds.
