Earn income with your data and sql skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest self-service freelancing marketplace for people like you.

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



Earn income with your data and sql skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest self-service freelancing marketplace for people like you.

Guides


vsn 3.1