Die eingehende Anfrage hat zu viele Parameter [doppelt]
Sep 28 2020
Ich habe die folgende Ausnahme SQLServerException: The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.beim Ausführen der SELECTAbfrage über den Ruhezustand. Hier ist meine Anfrage
Kennt jemand Lösungen dafür im Ruhezustand? Wird für jede Hilfe sehr dankbar sein, danke!
Antworten
1 Alien Sep 28 2020 at 21:40
Eine Problemumgehung für dieses Problem wäre, Daten in Blöcken abzurufen.
List<List<Long>> partitions = new ArrayList<List<Long>>();
List<Long> bucket = new ArrayList<>();
int count = 0;
for(Long id : ids){
count++;
if(count>1000){
count = 1;
partitions.add(bucket);
bucket = new ArrayList<>();
}
partitions.add(bucket);
}
List<PreStagePaymentData> data= new ArrayList<>();
List<PreStagePaymentData> temp;
for(List<Long> partition : partitions){
temp = findPreStageDataByPaymentIds(partition);
data.addAll(temp);
}