代码改变世界

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

2010-01-18 18:00  程序开发助手  阅读(629)  评论(0编辑  收藏  举报

写类似sql的 where ID in (1,2,3,4……) 字句的caml时,当id的数目大于153个时出现了

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

原因是:caml太长了,导致caml转化为sql语句后,sql语句也过大超过了sql server 的限制,msdn上有人提到下一个sql server的版本将会解决这个问题,但没有明确具体是什么版本。

解决的办法: 把这个caml减小,分成几个批处理完成。

这里有一篇文章写得比较好:

CAML: Nested Too Deep