Answered Questions

  • Differentiate between TRUNCATE and DELETE

    TRUNCATE deletes much faster than DELETETRUNCATEDELETEIt is a DDL statementIt is a DML statementIt is a one way trip,cannot ROLLBACKOne can RollbackDoesn't have selective features (where clause)HasDoesn't fire database triggersDoesIt requires disabling of referential constraints.Does not require

    amarparash

    • Sep 27th, 2008

    DELETE is a DML command so it works on row level, where TRUNCATE is a DDL command, so it works on object level, TRUNCATE actually deletes the table and recreates it, so whatever people say that it works faster or frees occupied space or high water mark or oil mark.The actual internal work was that.

    Shaveta Chawla

    • Sep 7th, 2007

    One main freature is when we have used auto increment clause the would return to next value after delete statement. e.g: if id =1000then after delete statement when we insert any record the value will be 1001 but if we use truncate statement then auto increment value will come to 0 positon