Truncate:
- Truncate command will delete the Table data only, it keeps the table schema as it is.
- Table data Can be rollback
- Example :
TRUNCATE TABLE User;
Drop:
- Drop command will delete both Table data table schema.
- Table data Can be rollback
- Example :
DROP TABLE User;
Delete:
- Delete command will delete the particular row based on the criteria in Where clause. If where clause is not mention in the squre, it will delete entire data, that is equalent to Truncate command action.
- Once delete the data, data can not be rollback. Make sure to include where clause in the delete query.
- Example :
DELETE FROM User WHERE userid = 5;
Note: This concept will work only for MS SQL. It may be different or reverse in oracle sql and MySQL