What is the maximum number of parameters I can pass using the SQL IN clause in SQL server 2008 and SQL server 2000? My program lets people pick items from a list to help run a query. To return the minimum amount of data, I've had to use the IN clause.

I'm pretty sure there's a limit to how many items I can put in the IN clause of one SELECT statement, but I don't know exactly what the limit is. For my case, I need to know the limit for SQL server 2000 and SQL server 2008.

Thanks!
There isn't a quantity limit on the number of items in the IN clause.  The only limit is that the entire batch cannot be more than the batch size maximum.  In SQL 2008, this is 65,536 * Network Packet Size. In SQL 2000, I'm not sure if the limit was smaller than that.

This link describes these limits for 2008