db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luan O'Carroll <lu...@xoetrope.com>
Subject Re: Identity column
Date Thu, 16 Aug 2007 15:11:59 GMT



Bryan Pendleton wrote:
> 
>> SQL state 42601: ALTER TABLE statement cannot add an IDENTITY column to a
>> table.
>> 
>> Is there any way to work around this?
> 
> Perhaps:
> 
> 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
> 
> thanks,
> 
> bryan
> 
> 
> 
> 

That's fine if there are no triggers or other objects associated with the
original table. Is there a system procedure or the like for finding such
objects?

-- 
View this message in context: http://www.nabble.com/Identity-column-tf4273368.html#a12183301
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message