TRUNCATE removes all rows from a table.
The operation cannot be rolled back and no triggers will be fired.
The following example will show what a TRUNCATE does:
SQL> TRUNCATE TABLE emp;
Table truncated.
The DROP command removes a table from the database. All the tables' rows, indexes and privileges will also be removed. No DML triggers will be fired. The operation cannot be rolled back.
The following example will show what a DROP does:
SQL> DROP TABLE emp;
Table dropped
本文详细介绍了数据库中TRUNCATE与DROP命令的区别及使用方法。TRUNCATE用于删除表中的所有行,不可回滚且不触发DML触发器;DROP则用于从数据库中移除整个表及其所有相关索引、权限等,同样不可回滚。
2299

被折叠的 条评论
为什么被折叠?



