Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 1.6 KB

mssqlserver-8621-database-engine-error.md

File metadata and controls

34 lines (28 loc) · 1.6 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
MSSQLSERVER_8621
MSSQLSERVER_8621
MashaMSFT
mathoma
04/04/2017
sql
supportability
reference
8621 (Database Engine error)

MSSQLSERVER_8621

[!INCLUDE SQL Server]

Details

Attribute Value
Product Name SQL Server
Event ID 8621
Event Source MSSQLSERVER
Component SQLEngine
Symbolic Name OPTIMIZER_STACK_OVERFLOW_ERR
Message Text The query processor ran out of stack space during query optimization. Please simplify the query.

Explanation

The size of the expanded query is the most likely cause of the error. The expanded query substitutes into the original query the definitions of each of the views, computed columns, [!INCLUDEtsql] functions, and common table expressions it references, as well as cascading actions like updating secondary indexes, views, and triggers.

Most likely the query is large in some dimension; for example, the number of tables referenced by view definitions, or a very large scalar expression.

User Action

Simplify the query by breaking the query into multiple queries along the largest dimension. First remove any query elements that are not really necessary, then try adding a temp table and splitting the query in two. Merely moving a part of the query to a subquery, function, or common table expression is insufficient because they get recombined by the [!INCLUDEtsql] compiler.