TechnoLearnAcademy

TECHNOLEARN

SQL TRUNCATE Statement

The TRUNCATE statement is used to remove all rows from a table while maintaining the structure of the table.

Syntax:      

                TRUNCATE TABLE tablename;
Note: Unlike the Delete statement, the truncate table statement doesn’t accept a where clause. It removes all rows from                 the table.
Let’s understand the truncate statement with an example.
         Table Emp

Example:

   Objective: In this example, we will delete all the records from the emp table.
                      TRUNCATE TABLE Tbl_Emp;
Scroll to Top