sqlite alter table add MULTIPLE columns in a single statement

user775187 picture user775187 · May 30, 2011 · Viewed 66.7k times · Source

Is it possible to alter table add MULTIPLE columns in a single statement in sqlite? The following would not work.

alter table test add column mycolumn1 text, add column mycolumn2 text;

Answer

mu is too short picture mu is too short · May 30, 2011

No, you have to add them one at a time. See the syntax diagram at the top of SQLite's ALTER TABLE documentation:

ALTER TABLE syntax

There's no loop in the ADD branch so no repetition is allowed.