SA-MP Forums Archive
How to add a column in an SQLite database - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to add a column in an SQLite database (/showthread.php?tid=353060)



How to add a column in an SQLite database - Danijel. - 22.06.2012

I was wondering how to add a new column at the END of the SQLite database because when i add a column it is on the beginning of the base.

Thank you.


Re: How to add a column in an SQLite database - ReneG - 22.06.2012

I'm not sure if the native SQLite supports it, but this is the syntax.

credits to whoever is the author @sqlite documenation


Re: How to add a column in an SQLite database - Lorenc_ - 22.06.2012

Add a column to a database? You mean a table right?

Code:
ALTER TABLE `table_name` ADD `column_name`;
You can select the format of the column by typing it after you write the column name:

Code:
ALTER TABLE `table_name` ADD `column_name` varchar(24);
Creates a string based on 24 characters for the new column. There is also a integer one which is simple 'INT' and instead of '24' you would insert the amount of digits that row would tend to use (maximum).

You don't have to even add the format afaik..