| 1. |
What Is Difference Between Delete And Truncate Commands? |
|
Answer» Delete command removes the rows from a table based on the condition that we provide with a WHERE clause. Truncate will actually REMOVE all the rows from a table and there will be no data in the table after we run the truncate command.
DELETE:
Note: DELETE and TRUNCATE both can be rolled back when surrounded by TRANSACTION if the current session is not closed. If TRUNCATE is written in Query Editor surrounded by TRANSACTION and if session is closed, it can not be rolled back but DELETE can be rolled back.
Delete command removes the rows from a table based on the condition that we provide with a WHERE clause. Truncate will actually remove all the rows from a table and there will be no data in the table after we run the truncate command. DELETE: Note: DELETE and TRUNCATE both can be rolled back when surrounded by TRANSACTION if the current session is not closed. If TRUNCATE is written in Query Editor surrounded by TRANSACTION and if session is closed, it can not be rolled back but DELETE can be rolled back.
|
|