FIX: Error when you execute a Transact-SQL query that contains a long case statement in SQL Server 2012

Taikoma: SQL Server 2012 DeveloperSQL Server 2012 EnterpriseSQL Server 2012 Standard

Symptoms


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.

Resolution


Status


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