SQLite – How to Increase Column Limit of a Table?

sqlite

SQLite: How can we configure the maximum number of columns allowed in a table?

Best Answer

You would have to obtain the Source Code for SQLLite, change the value of SQLITE_MAX_COLUMN, recompile the code and distrbute the resulting executable.

However, more than 2000 columns in a single table sounds wrong to me. Do you have lots of repeated fields in each row? That's poor Relational design.

If necessary, create a second table with the same primary key as the first and add your additional fields into that. You would have to issue two select statements to retrieve the values, though, because SQLITE_MAX_COLUMNS also applies to select statements, so you can't just join the two tables together.