In this tutorial, we will learn how to use the TRUNCATE TABLE
statement using SQL.
SQL TRUNCATE TABLE
statement is used to delete all the records (complete data) from the table. WHERE
clause is not used with TRUNCATE TABLE
statement.
TRUNCATE TABLE tableName;
TRUNCATE TABLE tbl_Test;
TRUNCATE TABLE
can be rolled back only if it is surrounded by Transaction and the current session is not closed. If TRUNCATE TABLE
statement is written in Query Editor surrounded by TRANSACTION
and if the session is closed, it can not be rolled back but DELETE
can be rolled back.