Assume that you execute a Transact-SQL query in Microsoft SQL Server 2012. When the query contains a long case statement, the query fails. Additionally, you receive the following error:

Msg 8631, Level 17, State 1, Line 7
Internal error: Server stack limit has been reached. Please look for potentially deep nesting in your query, and try to simplify it.

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:


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

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

What affected your experience?

Thank you for your feedback!