db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendle...@amberpoint.com>
Subject Re: Identity column
Date Wed, 15 Aug 2007 14:17:44 GMT
> SQL state 42601: ALTER TABLE statement cannot add an IDENTITY column to a table.
> Is there any way to work around this?


1) create a new table with all the columns of the existing table,
    plus the new identity column.
2) INSERT INTO new-table SELECT * FROM old-table to copy all the
    data from the old table to the new table.
3) drop the old table
4) rename the new table to be the old table name



View raw message