SQL TRUNCATE

The TRUNCATE command deletes all records from a table.

TRUNCATE is similar to DELETE but executes much faster and more efficient.

TRUNCATE cannot be used when a foreign key constraint prevents deletion.

Example

#

Delete all Supplier records.

TRUNCATE TABLE Supplier

This type of operation may not complete, because of referential integrity constraints.

Result:  29 records deleted

Syntax

TRUNCATE syntax.

TRUNCATE TABLE table-name

You may also like



Guides


vsn 3.1