How to add new column on already exist table in database

Dec 11, 2012 at 1:00 PM

Hi

I want to execute following command

ALTER TABLE table_name
ADD column_name datatype

I use

DBQuery.Create.Table("table_name").Add(DbColumn)

but it's give error table1 already exist becuase it create command like

CREATE TABLE table_name
(
column_name1 data_type,

)

and I want to add new column on already exist table.

Coordinator
Dec 11, 2012 at 1:26 PM

We don't currently support ALTER, it is on the cards, also not all engines support alter.

For the moment use a drop and create if possible (you could also migrate to a backup table if required).

Dec 27, 2012 at 2:16 PM

means I have already table tab1 with column col1,col2,col3 like this

tab1:

col1

col2

col3

I cann't add one more column col4 in table tab1