此 RPC 请求中提供了太多参数。 最大为2100。?
搜索查询返回了此错误。 我有一种感觉,因为当我尝试 ORM 另一个对象时,in 子句在从属对象上是巨大的。
显然 in 子句不应该一次构建 1 个参数。 谢谢伊巴蒂斯。
A search query returned this error. I have a feeling its because the in clause is ginormous on a subordinant object, when I'm trying to ORM the other object.
Apparently in clauses shouldn't be built 1 parameter at a time. Thanks ibatis.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
最好的办法是修改您的应用程序,将少于 2100 个参数传递给存储过程。 这是无法提高的 DBMS 限制。
Your best bet is to revise your application to pass less than 2100 parameters to the stored procedure. This is a DBMS limit that can't be raised.
当使用明显无辜的 LINQ to SQL 查询时,我遇到了同样的错误。 我只是想检索 id 包含在数组中存储的所有记录:
事实证明 ids 数组有超过 2100 个项目,并且 DataContext 似乎在结果中为数组中的每个项目添加了一个参数SQL 查询。
最后,这是我的代码中的一个错误,因为 ids 数组不必有这么多项目。 但无论如何,值得记住的是,在 LINQ to SQL 中使用此类构造时需要一些额外的验证。
I got this same error when using an apparently innocent LINQ to SQL query. I just wanted to retrieve all the records whose ids were amongst the ones stored in an array:
It turned out that the ids array had more than 2100 items, and it seems that the DataContext adds one parameter for each item in the array in the resulting SQL query.
At the end it was a bug in my code, since the ids array had not to have so many items. But anyway it is worth to keep in mind that some extra validation is needed when using such constructs in LINQ to SQL.
您可以执行以下操作:
You can do a few things:
如果您向单个存储过程传递 2100 个参数,那么您只是做错了什么。 不要提高限制或试图解决这个令人厌恶的问题,找出如何正确做事的方法。
If you are passing 2100 parameters to a single stored procedure, you are simply doing something wrong. Don't raise the limit or try to work around this abomination, figure out how to do things right.