T-SQL 中的奇怪崩溃 - 这是什么?

4 sql-server parallelism

发生以下错误的典型情况是什么,这意味着什么?

另请注意,当查询失败时,我发现自己与服务器断开了连接(但我自己没有观察到这一点)。

Location:     "xact.cpp":4253
Expression:   !m_parNestedXactCnt
SPID:         56
Process ID:   2208
Description:  Trying to use the transaction while there are 1 parallel nested xacts outstanding
Location:     "xact.cpp":4362
Expression:   !m_parNestedXactCnt
SPID:         56
Process ID:   2208
Description:  Trying to use the transaction while there are 1 parallel nested xacts outstanding
Msg 3624, Level 20, State 1, Line 131
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.
Run Code Online (Sandbox Code Playgroud)

And*_*mar 5

这看起来像是 SQL Server 代码中的失败断言。基本上,您已经发现了 SQL Server 中的一个错误。你可以把它提交给微软。

一个快速的解决方案是option (maxdop 1)在查询的末尾添加;这指示 SQL Server 不要将查询分布在多个处理器上(也称为并行化)。