Re: [sqlite] The best way to delete a column ?
Stef Mientki wrote: I just read it's not possible to delete a column in an existing table. Now what would be the best way to remove the column indirect (from Delphi code), I've never needed to do this so the following are just hints. The special table "sqlite_master" contains the SQL that was used to create the table in the first place. You can erad it like any other table. Just copying a table won't recreate any indexes, constraints, triggers etc which exist on that table. You can create a table from the result of a select. As a first attempt I'd do something like: start transaction get the table schema and that of any triggers etc alter the schema to lose the unwanted column (in Delphi) drop the triggers, indexes etc rename the table you want to change create new table with the new structure copy the data from old table to new table recreate the new triggers, indexes etc end transaction drop the old table vacuum the database NB: I haven't tried or tested the above. ;) Martin - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] The best way to delete a column ?
hello, I just read it's not possible to delete a column in an existing table. Now what would be the best way to remove the column indirect (from Delphi code), would it be something like this: start transaction create new table with the same structure, but without the column to delete (how?) copy the data from old table to new table delete the old table rename the new table to the old name vacuum-clean the database end transaction I this the best way, or are there any other ? Sorry I'm just starting SQL, so I just used human SQL. (and therefor a complete code section would be welcome ;-) thanks, Stef Mientki - To unsubscribe, send email to [EMAIL PROTECTED] -