November 2003
Intermediate to advanced
816 pages
14h 53m
English
The TRUNCATE TABLE command removes all rows from a table without logging each row deleted. No logging means it runs faster than DELETE FROM tablename. It also resets IDENTITY column to its initial (seed) value. TRUNCATE TABLE cannot be used on parent table of Foreign Key constraint.
The syntax of TRUNCATE TABLE and some examples of its use are shown here. In addition, Table 4-3 offers a comparison between DELETE FROM table and TRUNCATE TABLE table.
TRUNCATE TABLE tablename
Example:
|
Read now
Unlock full access