ERROR: The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.
RequestError: The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.
at handleError (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/node_modules/mssql/lib/tedious/request.js:384:15)
at Connection.emit (node:events:517:28)
at Connection.emit (node:domain:489:12)
at Connection.emit (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/node_modules/tedious/src/connection.ts:1906:18)
at RequestTokenHandler.onErrorMessage (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/node_modules/tedious/src/token/handler.ts:388:21)
at Readable.<anonymous> (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/node_modules/tedious/src/token/token-stream-parser.ts:23:7)
at Readable.emit (node:events:517:28)
at Readable.emit (node:domain:489:12)
at addChunk (node:internal/streams/readable:335:12)
at readableAddChunk (node:internal/streams/readable:308:9)
at Readable.push (node:internal/streams/readable:245:10)
at next (node:internal/streams/from:98:31)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
It looks like there could be ways to get around this by chunking the data which could be something we should look into but for now it looks like your approach is the best method to take.
Interesting when I did a quick search on the error it shows it as being a documented SQL limit, I will check to see if we made any changes to the MSSQL node but it will likely be the same thing, We would need to look at chunking the data into smaller pieces to work around the limit but for now the split in batches is the best approach to work around this.
For the time being i will use the Loop Over Items but as you can see with the older version 1.9.3 it is working just fine. Something definetely must have changed with the latest version.
The difference is likely to be around the change to parameters to help prevent sql injection, In theory you could use the Execute Query option as well which should handle it ok.
When it comes to parameter inputs MSSQL has a limited amount it can handle in one transaction, to fix this we may need to either revert the change we made or handle the batching in the node instead of outside of it.
Our priority is set based on how popular the node is, how many users may be impacted by the issue based on the telemetry data and some other factors, In this case when I created NODE-909 (our dev ticket) and inputted the information for scoring it has come out as a low priority at the moment so we will fix this but there is currenlty a work around available.
If we start to see more reports of this error the priority will be raised, Just because something is marked as low it also doesn’t mean that someone won’t pick it up and put out a fix for it.