[quote=33483:@Dave S]Just a side note… while this is the way to do it with SQLite… it may not be the best way for other Database Engines.
If the database engine supports “TRUNCATE TABLE xxxx” use it instead (SQLite does not have this syntax).
For example in Oracle… saying “DELETE FROM xxxx” causes a UNDO pool to be created until a COMMIT is executed.
Where a “TRUNCATE xxxx” does not.[/quote]
That really depends on whether you want to be able to rollback the delete or not
If not truncate in a lot of db engines is way faster
Sure
And if all you really want is to immediately & irrevocably remove the contents without the possibility of rolling it back a truncate is usually the quickest
But that’s not what I said
If you do a “delete from …” operation in a transaction you have the possibility of rolling it back
If you truncate you usually don’t regardless of whether its in a transaction or not
So, as I said [quote=33522:@Norman Palardy]That really depends on whether you want to be able to rollback the delete or not
If not truncate in a lot of db engines is way faster[/quote]