Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the max number of items in IN clause?
Message
 
 
À
27/04/2010 18:46:22
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01462166
Message ID:
01462282
Vues:
60
>>Seems to be fixed.
>>
>>Here is a test:
>>
>>select * into csrTemp7 from transact where sale_no in ;
>>(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29, ;
>>30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51, ;
>>52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73, ;
>>74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97, ;
>>98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115, ; 
>>116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133, ;
>>134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159) 
>>
>>If you add one more, there would be an error.
>
>That is not right. I remember my tests (was about speed not the limit) had more than 6000 items. Since you are not giving your exact syntax no way to guess what you might be doing wrong.
>
>OTOH I wouldn't use IN () if the temcount is more or less than 5-10 items. I would instead join cursor/table.
>PS: Since your SQL is T-SQL I assume you were asking the limit in SQL server. AFAIK there the limit is beyond what you can send from VFP (aka no limit).
>And of course I guess you use a version where you corrected the typo.
>Cetin

Hi Cetin,

The limit is in VFP and Fabio aleady figured this out - it depends on sys(3055). Sure, we're not going to use such long list - it's just a co-worker asked me this morning and I thought I'll ask here.

Thanks again.

BTW, you're right - haven't noticed I changed the syntax. I was testing it in VFP and then switched to SQL Server to test, where it worked no problem.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform