Subject Re: [firebird-support] Change Datatype (2)
Author Martijn Tonies
> >Because nobody answered to Subject 'Change Datatype', i will ask in a
> >different way.
> >
> >I use following statements for converting a primary key with smallint
> >datatype to an integer datatype:
> >
> >
> >
> You can do that in the easy way with IBexpert Personal edition (is free).
> Dont konw if Database Workbech also do it.

Database Workbench cannot do that - and has good reasons
for it.

Firebird disallows this change because of the automagically
created indices for PKs. FKs can point to a PK.

Simply changing the underlying datatype is not a particular
good idea.

The best thing you can do is:
- drop any dependent FKs
- drop the PK
- change the datatype
- recreate the PK
- recreate the FKs

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Upscene Productions