Here is a new error condition I thought I’d let you know about.
One of my customers purchased my SnapShot! documentation tool and was receiving Generic SQL Server errors on what appeared to be the simplest queries.
After looking at the platform trace, I see this error message:
Exception: System.Data.SqlClient.SqlException (0x80131904): Internal error: Server stack limit has been reached. Please look for potentially deep nesting in your query, and try to simplify it.
What in the heck does that even mean?
After a small amount of searching, I ran into this Microsoft KB article.
It seems that the error was corrected in individual rollups for both SQL Server 2012 SP1 and SP2.
This was probably caused by a GINORMOUS SQL Case statement. This particular customer has what I am fairly certain to be the largest number of custom entities ever added to Dynamics CRM and SQL Server was having issues when creating a query that looks like this: