Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at cf.Objective() 2010 (Minneapolis, MN) with:

Internal Query Processor Error: The Query Processor Ran Out Of Stack Space During Query Optimization

By Ben Nadel on
Tags: SQL

Wooohooo! I got a SQL server error that I have never seen before:

Internal Query Processor Error: The Query Processor Ran Out Of Stack Space During Query Optimization.

I am working on an old report for a client that originally had a small set of data and now has an ENOURMOUS set of data. Looks like it's time to start breaking a query up into smaller queries - give the SQL server less to worry about.



Reader Comments

Is it a coincidence that the filename of this page starts with "500"? I find that I sometimes get this error when combining more than 500 fields in one expression in a SQL Server query.

We received this error due to a bug that kept on appending items to a list that we used in an IN clause of a SQL Statement.
It blew up since the IN statement had 35,000 arguments.

Creating a temp table per the MS article is probably the best solution since you can throw a clustered index on the column.

This part of the MS article scared me a bit:
In some cases, SQL Server may actually shutdown as a result of the stack overflow.