Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many columns we can create in a table in SQLite?

I am creating a SQLite database for my iPhone projects. I have table called products in my database.

I want to have 35 columns in the products table. I am able to create 26 columns only. I add any more its not getting added to the table. I am accessing the database via SQLite manager from Firefox. Is there any limit for the columns. How can I overcome this issue?

like image 937
Warrior Avatar asked Sep 12 '11 07:09

Warrior


1 Answers

This is most likely a limitation of the Firefox plugin or has to do with your naming setup. From the SQLite documentation:

The default setting for SQLITE_MAX_COLUMN is 2000. You can change it at compile time to values as large as 32767. On the other hand, many experienced database designers will argue that a well-normalized database will never need more than 100 columns in a table.

Solution: use the command line interface sqlite3.

like image 188
Mundi Avatar answered Sep 21 '22 17:09

Mundi