Ive asked this question several times and yet to get a COMPLETE answer... How to you implement the ALTER TABLE statement to add a column to a database. Can someone PLEASE give me an example?
Right-click the table you wish to duplicate, point to Script Table as, then point to CREATE to, and then select New Query Editor Window. Change the name of the table. Remove any columns that are not needed in the new table. Select Execute to create the new table.
Right-click the table you want to copy in Database Explorer and select Duplicate Object.
The ALTER TABLE statement is used to add, delete, or modify columns in an existing table. The ALTER TABLE statement is also used to add and drop various constraints on an existing table.
Please read the SQLite ALTER TABLE reference, and this Android SQLite article:
database.execSQL("ALTER TABLE " + your_table_name + " ADD COLUMN " + new_col_name + " int");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With