TRUNCATE TABLE Statement:
TRUNCATE Statement is used to remove all records from a table. It is a Data Definition Language (DDL) Statement as it deletes all records and only structure remains. It is similar to delete statement but without where clause as it will also deletes all records if a condition is not specified.
Syntax:
TRUNCATE TABLE tablename;
Example:
TRUNCATE TABLE Employee;
The above query will delete all records from Employee table. We can do the same by using the following query:
DELETE FROM Employee;
As in the above query we have not specified any condition so it will delete all records of Employee table.
0 Comment(s)