User:Gelbard/Sandbox

In SQL, the   statement removes all the data from a table. The  statement is not actually a part of the SQL standard, but many relational database management systems implement it.

Usage
The basic truncate statment has this syntax:

The syntax may differ between databases. For example, in Oracle Database the syntax is as mentioned above, but in DB2 the statement lacks the word.

Difference between and
Unlike the  statement, which is a DML type statement, the   statement is a DDL type statement, and therefore it differs from the seemingly same statement:    .

The differences are as follows:

DB2

 * The  statement can ignore Delete triggers.
 * The  statement can perform immediate.
 * The  statement can keep the storage allocated to the table.

Oracle

 * Oracle database automatically performs a  before and after the   statement.
 * The  statement can drop all the storage allocated to the table.
 * The  statement can reset the high-water mark for the table.
 * The  statement ignores triggers.
 * A  statement can not be issued on a table which is a part of a cluster.
 * A  statement can not be issued on the parent table of an enabled foreign key constraint.