Sunteți pe pagina 1din 1

TRUNCATE TABLE t Issues an implicit COMMIT You cannot ROLLBACK a TRUNCATE statement Deallocates all space used by the

removed rows except that specified by the MINEXTENTS storage parameter Sets the NEXT storage parameter to the size of the last extent removed from the segment by the truncation process If the REUSE STORAGE clause is used, the space from the deleted rows allocated to the table is retained. This space can subsequently be used only by new data in the table or cluster resulting from insert or update operations Resets the high water mark of the table Can be more efficient than dropping and re-creating a table Can be faster than removing all rows with the DELETE statement You cannot selectively delete rows. Its all or nothing DELETE FROM t You have to explicitly COMMIT a DELETE statement to make it permanent You can ROLLBACK a DELETE statement if you change your mind before you COMMIT Space is not deallocated Does not reset the high water mark, which may result in poor performance (especially in full table scans) Can be slower than removing all rows with the TRUNCATE statement You can selectively delete rows based on some criteria in the WHERE clause Filed under SQL. Follow any responses to this entry through this RSS 2.0 feed.

S-ar putea să vă placă și