December 13, 2005 at 4:06 am
if I use an IN operator with 1000 items something like the following:
empno in (1001,1002..........3000)
Will it work? May I know the max. limit of IN operator?
December 13, 2005 at 4:33 am
Look at these MS KB articles.. It seems that you can indeed have several thousand values quite easily.... However, just make sure you upgrade to SP4 as it can cause some issues on your server with compilations, etc.
http://support.microsoft.com/kb/816069/
http://support.microsoft.com/kb/829205/EN-US/
http://support.microsoft.com/kb/296612/
The last one talks about an issue fixed in SP2 and discusses how SQL internally treats the IN operator as a series of ORs and how statistics, etc are analysed... Again another reason to have the latest Service pack.. But at least you know you can have a lot of IN values
![]()
December 13, 2005 at 6:03 pm
Hello Ian,
thanks very much for the links...Now I could understand bit more about the IN operator.
bye
Jag
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply