Additional SQL Server features and topics not covered by specific categories
Update: Erland pointed out that Naresh's ERRORLOG already shows -T4696 as a startup parameter, which I missed. That's the documented workaround for the known issue below, so this probably isn't the cause here. I've left the details in case they help someone on the same build, but the input buffer in SQLDump0027.txt is still the quickest way to see what's actually crashing.
One more thing worth checking. Your build, 17.0.5015.4, is the October security update for CU9 (KB5126967). Microsoft lists a known issue for this build that fits your symptoms closely: a dump on every restart, while SQL Server keeps running.
The known issue
The KB article calls it "Access violation when you query sys.dm_exec_requests during database recovery". If anything queries sys.dm_exec_requests while a database is still recovering, which includes startup recovery right after a restart, SQL Server can raise c0000005 EXCEPTION_ACCESS_VIOLATION and write a dump. A monitoring tool or a SQL Agent job that runs as soon as the service starts is the typical trigger. The issue is still listed as unfixed in CU10 (17.0.5035.5), so updating to CU10 alone won't fix it.
How to confirm it before changing anything
The dump text file names the statement that crashed. Open SQLDump0027.txt in the LOG folder and look for the Input Buffer section near the top. Then check two things.
- What the input buffer shows. If it shows a query or procedure that reads
sys.dm_exec_requests(orsys.sysprocesses), this known issue is very likely the cause. The program name or procedure name usually tells you which tool sent it. - What the ERRORLOG shows. The dump should appear while databases are still starting up or recovering, before the "Recovery is complete" message.
If the input buffer shows something unrelated, this isn't your issue, and Erland's suggestions plus a support case are the way forward.
If it is the known issue
Microsoft documents three workarounds:
- Keep monitoring queries away from recovering databases. Delay the monitoring tool or Agent job until recovery completes after a restart. This is the least intrusive fix.
- Trace flag 4696. This opts out of the code change that causes the crash. Because the dump happens at startup, it would need to be a startup parameter (
-T4696in SQL Server Configuration Manager). Its documented side effect is that monitoring queries on availability group secondary replicas can return errors 976 or 978, as they did before this update. As Erland said, don't add trace flags on a guess. Only use this one after the input buffer confirms the issue, and test it outside production first. - Uninstall the update until Microsoft ships a fix.
I drafted this answer with help from Copilot and verified the details myself, in line with the Microsoft Q&A AI usage policy.