Alter a table column with auto increment by 1 in derby

Nitesh Verma picture Nitesh Verma · Jan 14, 2013 · Viewed 47.1k times · Source

I have created a table in derby Netbeans and now i realize that i need to make a column as auto incremented by 1 which is a primary key. How can i do so? I tried the following code but was in vain.

ALTER TABLE ISSUERECIPT ALTER IRCODE SET INCREMENT BY 1;

Do i need to create the table once again or can it be possible some other way?

Answer

Nitesh Verma picture Nitesh Verma · Jan 14, 2013

I have found an alternate solution, i dropped the column from the database (thanks vels4j) added the column once again from the netbeans derby UI as shown below:

enter image description here