There is a limit of 2,100 parameters which can be passed to a Sql Server query i.e. via ADO.Net, but what are the documented limits for other common databases used by .Net developers – in particular I’m interested in:
- Oracle 10g/11g
- MySql
- PostgreSql
- Sqlite
Does anyone know?
Oracle: 64,000. Source
MySQL:
MySqlCommand.Prepare()(and specifyingIgnorePrepare=falsein the connection string), then there is a limit of 65,535 parameters (becausenum_paramshas to fit in two bytes).PostgreSql: EDIT: 34464 for a query and 100 for a function as per Magnus Hagander’s answer (Answer copied here to provide a single point of reference)
SqlLite: 999 (SQLITE_MAX_VARIABLE_NUMBER, which defaults to 999, but can be lowered at runtime) – And for functions default is 100 parameters. See section 9 Of Run-time limits documentation