> I have an Firebird database with a field that stores a small string 
> value in a VarChar(255). I want to change that now to a VarChar(20) 
> which is plenty big enough so that I can create an index on 
> it. But of 
> course, Firebird won't let me reduce the varchar size since it is 
> already populated (although no values over 20 chars long).

alter table <tablename> add tempcolumn varchar(20);
update <tablename> set tempcolumn = <sourcecolumn>;
alter table <tablename> drop <sourcecolumn>;
alter table <tablename> alter tempcolumn to <sourcecolumn>;

Cheers,
Carl
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to