4

I am receiving errors when I run the following query:

SELECT (
        SELECT 1
        FROM dbo.AccountEntry AE
        WHERE AE.Account = P.Account
        )
FROM dbo.Proposal P
WHERE P.id = @Id

When run via ADO.NET it gives:

Warning: Fatal error 3624 occurred at Jun 20 2016 2:28AM. Note the error and time, and contact your system administrator. A severe error occurred on the current command. The results, if any, should be discarded.

When run in SSMS it gives

Location: statutil.cpp:4128
Expression: iKey < m_statBlob.GetHeader()->GetKeyCount()
SPID: 59 Process ID: 1732
Msg 3624, Level 20, State 1, Line 1
A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software bug or data corruption. To check for database corruption, consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during setup, a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a QFE from Technical Support.
Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.

Interestingly this code works when setting @Account to P.Account:

select 1 from dbo.AccountEntry AE where AE.Account = @Account

I have tried restarting the server.

I have tried dropping all indexes and statistics.

I have run DBCC CHECKDB and it returns no errors.

We don't believe anything has been changed about the server since Friday when it was running happily.

SQL Version: Microsoft SQL Server 2012 - 11.0.5343.0 (X64) May 4 2015 19:11:32 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.2 (Build 9200: ) (Hypervisor)

  • 2
    Fastest support would come by submitting case with Microsoft. I would suggest applying SP3 at the most. – Shawn Melton Jun 20 '16 at 4:29
  • 1
    What isolation level you are running on ? How big is the table. If possible, take a backup of the database, restore it on a test server and then Can you bcp out the data, drop the table and bcp in the data to see if it fixes the problem ? – Kin Shah Jun 20 '16 at 14:52
7

This issue is to do with corrupt/invalid statistics.

A specific case where it can occur is mentioned in this connect item

The Metadata of disabled Non-Clustered Indexes becomes invalid, if you change the keys of the Clustered Index, and this caused the failure that you experienced.

With the workaround being to drop the disabled indexes.

If the situation above doesn't apply to you then try and find out the specific table with the problem hopefully dropping the statistics on this specific table or both tables if you can't pinpoint the problem one should do the job (and then recreate the stats if required).

If neither of the above work then probably time to open a case with Microsoft PSS.

Also you appear to be on SP2 + Security Bulletin MS15-058. There have been a lot of cumulative updates and another service pack since then. Possibly the issue you are experiencing is already fixed in one of these.

1

I received the same exact error on SQL Server 2012 SP3 from an application event log. The error mentioned a specific stored procedure.

When reviewing all of the code, the one that stood out was a table truncate statement. Sure enough when I attempted to update statistics on that target table, my SSMS session would get disconnected with the following SQL Server error below.

To resolve, I went ahead and dropped the table and recreated it. I then recompiled the offending stored procedure.

"A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software bug or data corruption. To check for database corruption, consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during setup, a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a QFE from Technical Support. Msg 596, Level 21, State 1, Line 0 Cannot continue the execution because the session is in the kill state. Msg 0, Level 20, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.