Sign in to follow this  
pi_equals_3

[web] IN maximum value list in Access

Recommended Posts

Does anyone know if there's a limitation to the number of values that can be listed in an IN clause using Microsoft Access 2000? If so, any hints as to what it would be? I became aware that this limitation may be a problem in an application I'm developing, and fixing the problem would require a lot of work. On top of that, I can't seem to find anything about it in the documentation or on google. Thanks.

Share this post


Link to post
Share on other sites
IIRC you are only limited by the maximum size of an Access SQL query, which, again if IIRC, is 32KB (SQL Server supports 16MB queries:)).

EDIT: Just under 64KB is the correct limit for Access SQL statements.

Share this post


Link to post
Share on other sites
Just to note, I have actually done what you are doing - having very, very large WHERE Field IN (1,3,6,7,...) (several of them in the same query in fact). Why I say that I don't think there is an actual limit on values in an IN clause is that I've basically taken them up to around the maximum you can get within the SQL character limit (in the order of several 1000 values) and not encountered any problem. The only way this might not be a legitimate test depends on how Access can optimize IN conditions (it may be removing redundent values [such as 1,2,3] and replacing them with ranges [1-3])

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this