Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
TRUNCATE command cannot be rollback, it is faster and delete the data including table structure also releases the memory allocated to the table
DELETE command can be rollback and only the data in the table will be deleted.
Delete is the command that only remove the data from the table. It is DML statement. Deleted data can be rollback.
Truncate is the DML command. This command delete the data from table. But there is one difference from ordinary delete command. Truncate command drop the storage held by this table. Drop storage can be use by this table again or some other table. This is the faster command because it directly drop the storage
Delete is a simple command to remove a data from a particular format and truncate means removal of a data from a file in shorter and quicker way.
Delete: The DELETE command is used to remove rows from a table. A WHERE clause can be used to only remove some rows. If no WHERE condition is specified, all rows will be removed.
Truncate: TRUNCATE removes all rows from a table. The operation cannot be rolled back and no triggers will be fired. As such, TRUCATE is faster and doesn't use as much undo space as a DELETE.
TRUNCATE is a DDL statement. It issues auto-commit after the exectution of the statement. DELETE keeps records in buffers(temporary storage) till the first ROLLBACK or COMMIT. You can use conditions on DELETE like WHERE etc. You can't using TRUNCATE.
truncate is used to remove all the rows from the table... where delete is used to remove particular rows from the table by using 'where' condition.Truncate is DDL statement and Delete is a DML statement.
The delete command is used to remove rows from a table while Truncate is the need to commit or roll back the transaction to make the changes permanent
Delete is a DML statement, it is safer as it can be rolled back WHILE Truncate cannot be rolled back. It removes the rows from the table. The good part of truncate is that it creates more storage space
Truncate removes all the rows from a table. Delete with a where clause can deleterows (as specified using where clause) from a table.
DELETE
Truncate is a DDL command and Delete is a DML commnad. Truncate commnd we can not rollback and delete command we can rolback. truncate commnad is fast compare to delete commnad. truncate commnad release space.