Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements >

TRUNCATE (XPS)

Use the TRUNCATE statement for quick removal of all rows from a table and all corresponding index data. Only Extended Parallel Server supports this implementation of the TRUNCATE statement, which is an extension to the ANSI/ISO standard for SQL.

Dynamic Server supports a different implementation of TRUNCATE, as described in the section TRUNCATE (IDS) .

Syntax

Read syntax diagramSkip visual syntax diagram                       .-TABLE-.
>>-TRUNCATE--+------+--+-------+--+--------+--table------------><
             '-ONLY-'             '-owner.-'
 

Element Description Restrictions Syntax
table Name of table from which to remove all data Must exist Database Object Name, p. Database Object Name

Usage

You must be the owner of the table or have DBA privilege to use this statement.

The TRUNCATE statement does not automatically reset the serial value of a column. To reset the serial value of a column, you must do so explicitly, either before or after you run the TRUNCATE statement.

TRUNCATE is not equivalent to DROP TABLE. After TRUNCATE successfully executes, the specified table (and all its columns, and any synonyms, views, constraints, indexes, triggers, and access privileges) still exists in the database schema, but with no rows of data.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]