Subject | Re: [firebird-support] Moving primary key to another column |
---|---|
Author | Milan Babuskov |
Post date | 2012-08-10T15:32:43Z |
Matthias Hanft wrote:
http://firebirdfaq.org/faq380
Regards,
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================
> let's say I have a table like thisAll explained here:
>
> NBR INTEGER PRIMARY KEY
> SOMEFIELD1 VARCHAR
> SOMEFIELD2 VARCHAR
> [...]
>
> Now I don't want to be NBR the primary key any more (the numbers there
> have a special meaning where I need to have some "0" entries now); I'd
> like to insert another "ID" colum which should be the new primary key
> (and filling it automatically from 1 to N by a generator).
>
> Is this possible within the "live" database/table, or do I have to create
> a new table with the colums needed, and do some "INSERT INTO NEWTABLE
> SELECT FROM OLDTABLE" and finally rename the new table to the old name?
>
> The server is FB 2.0.3; I have IBExpert and FlameRobin available.
http://firebirdfaq.org/faq380
Regards,
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================