- Lean SQL Tutorials
- DDL - Data Definition Language
- DML - Data Manipulation Language
- CREATE Command
- ALTER Command
- USE Command
- DROP DATABASE, DROP TABLE
- TRUNCATE TABLE Command
- SELECT SQL Statement
- INSERT SQL Statement
- UPDATE SQL Statement
- DELETE SQL Statement
- SQL WHERE Clause
- SQL ORDER BY Clause
- SQL GROUP BY Clause
- SQL TOP Clause
- SQL DISTINCT Clause
- SQL LIKE Operator
- SQL IN Operator, NOT IN
- SQL BETWEEN Operator
- SQL AND & OR Operator
TRUNCATE TABLE Command in SQL – DDL Statements
TRUNCATE TABLE Command – DDL Statements
The TRUNCATE TABLE command used to delete all the rows/records from entire table.
The TRUNCATE command also remove the index from columns.
If we want to delete the table structure then use DROP Command. The TRUNCATE TABLE Command only delete the data from the table not the structure of table from database.
The TRUNCATE TABLE command cannot delete any data that would violate FOREIGN KEY or any other constraints.
TRUNCATE TABLE Command Syntax:
TRUNCATE TABLE tablename
tablename is the name of table to be truncated.
Example of TRUNCATE TABLE Command:
TRUNCATE TABLE Student
Delete all the records from Student table when execute above truncate command.