当前位置: 动力学知识库 > 问答 > 编程问答 >

SQL Server IN (maximum,params,allowed,in,here)?

问题描述:

How many params can I pass to SQL Servers IN() function?

SELECT * FROM TABLE where ID IN ( 1,2,3,4,5,..,.,....)

网友答案:

According to documentation - "many thousands".

网友答案:

This limit is 65,535.

Refer the Causes section HERE.

网友答案:

Including an extremely large number of values (many thousands) in an IN clause can consume resources and return errors 8623 or 8632. To work around this problem, store the items in the IN list in a table.

Error 8623:

The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.

Error 8632:

Internal error: An expression services limit has been reached. Please look for potentially complex expressions in your query, and try to simplify them.

分享给朋友:
您可能感兴趣的文章:
随机阅读: