thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Data & Analytics · Intermediate

TRUNCATE Statement

A statement that quickly removes all rows from a table while keeping its structure, typically with minimal logging.

Definition

TRUNCATE deallocates data pages instead of deleting rows one by one, usually resets identity counters and does not fire DELETE triggers. It cannot take a WHERE clause and is blocked when other tables reference the table by foreign key (in SQL Server). It can be rolled back inside a transaction in SQL Server but auto-commits in Oracle.

Example

TRUNCATE TABLE StagingOrders;

Exam tip

Choose TRUNCATE to empty a staging table fast; choose DELETE when you need a WHERE clause or triggers.

Related terms