0
Difference between truncate and delete?
when we are delete a table, we can perform rollback. where as truncate we can't rollback.
2 Respostas
+ 2
truncate is a ddl command it means it used to define. you can not rollback it because it does not keep any logs and does not lock . also you can not use where clause or fire a trigger in case of truncate. any auto increments will be reset after truncate.
otherhand delete is a dml statement and can be rolled back.
another command is drop to drop the schema IMG with data.
0
Delete gives an optional where clause to identify rows to be deleted. On the other hand truncate will delete all rows on the specified table.