Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Troubleshooting SQL Server Stack Overflow error

How can I effectively troubleshoot this error?

The query processor ran out of stack space during query optimization. Please simplify the query.

Msg 8621, Level 17, State 2

I've tried to attaching profiling, but I'm not sure I have the right messages selected. I do see the error in there. The Estimated Execution Plan gives this error as well.

The sproc I am calling is just doing a really simple UPDATE on one table. There is one UPDATE trigger, but I disabled it, yet it still is giving me this error. I even took the same UPDATE statement out and manually supplied the values. It doesn't return as fast, and still gives me the error.

Edit: OK, my generated script is setting the PK. So if I set the PK and another column, I get this error. Any suggestions along those lines?

like image 521
Daniel A. White Avatar asked Sep 11 '26 20:09

Daniel A. White


1 Answers

There's a microsoft KB article about this.

Basically it's a bug and you need to update. I'm assuming you are running SQL Server 2005 sp2?

like image 130
JNK Avatar answered Sep 14 '26 21:09

JNK