21 November 2008

Some part of your SQL statement is nested too deeply...

I ran into this error after testing a 'on change' workflow that was itself updating the item it was running on (which of course creates a loop):

"Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries."

turns out that this is caused by a bug in SharePoint in combination with too many items returned in a CAML query from the workflow history list.

this post explains it nicely: http://blogs.blackmarble.co.uk/blogs/rhepworth/archive/2008/07/03/workflow-history-and-sql-error.aspx

2 comments:

Alamzeb said...

Hello,
Still cannot find a solution to this problem. I cleared up the workflow history list and it did'nt work as suggested on most of the blogs. Can you please help?

Regards,
Alamzeb Nasar

Alamzeb said...

Hello,
Still cannot find a solution to this problem. There is problem with only 2 items in my list that whenever I try to view the items or edit them this error is thrown in event logs. I cleared up the workflow history list as suggested by most of the blogs, but it did not work. Can you please help me with this?
Regards,
Alamzeb Nasar