Applies ToSQL Server 2008 R2 Service Pack 2 SQL Server 2008 R2 Developer SQL Server 2008 R2 Enterprise SQL Server 2008 R2 Standard SQL Server 2012 Developer SQL Server 2012 Enterprise SQL Server 2012 Standard SQL Server 2014 Developer - duplicate (do not use) SQL Server 2014 Enterprise - duplicate (do not use) SQL Server 2014 Standard - duplicate (do not use)

Symptoms

Assume that you use Microsoft SQL Server 2008 R2, SQL Server 2012, or SQL Server 2014. When you execute a query by using TOP N and ORDER BY, the query hits an assert failure similar to the following:

Location: "qstopsrt.cpp":384Expression: fFalseSPID: <SPID>Process ID: <ProcessID>Location: qxcntxt.cpp:1052Expression: cref == 0SPID: <SPID>Process ID: <ProcessID>Msg 3624, Level 20, State 1, Line 2A 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 0A severe error occurred on the current command. The results, if any, should be discarded.

Note The fix may also apply to that the query plan contains "Sort (Top N Sort)."

Cause

The issue occurs because an internal error in the query execution engine.

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.