Is there a limit to the number of columns a table can have?


#1

Question

Is there a limit to the number of columns a table can have?

Answer

Yes, there is a limit to the number of columns a table can have.

In SQLite in particular, the upper bound for this number of columns is stored in a parameter called SQLITE_MAX_COLUMN, and by default, it is set to 2000 columns.

This value can be changed during compile time and can be set up to a maximum value of 32767. However, realistically, your tables will probably never need these many columns, but, it is available as an option if ever needed.