database – What is the limit of IN operator arguments in SQL Server?

Question:

In Oracle there are 1000 arguments, what is the limit in SQL Server?

Answer:

There is no set limit in documentation and I couldn't find an answer that determines the exact size, so we can assume that there is no specific limit.

It's certainly not unlimited, but the limit can be related to other things. One possibility is the batch size which is equivalent to 65536 network packets. Another can be the number of parameters of the function. But I'm not sure if this applies. The size of any function is 2100 arguments, as per the documentation. It is possible that some more limit exists.

So unlike Oracle, SQL Server doesn't have this specific limitation.

If you encounter a limit, in some situations you can still split into more than one IN and merge with an OR if that's still possible.

If you are using too much, you may be doing something wrong.

Limits documentation

Scroll to Top