SQL - TRUNCATE Table Statement
The TRUNCATE statement is used to delete all rows from a table in the database. It works the same as the DELETE
statement, but you cannot use the WHERE clause with the TRUNCATE statement. The deleted rows using the TRUNCATE statement cannot be recovered. It deletes the rows permanently.
Syntax
TRUNCATE TABLE table_name;
The following command will remove all data from the Employee
table in SQL Server, Oracle, MySQL, PostgreSQL databases.
TRUNCATE TABLE Employee;
The TRUNCATE command is not supported in SQLite. But alternatively, the DELETE
command can be used to Delete
all the data from the table.
DELETE FROM Employee;