TRUNCATE TABLE
deallocates data pages; identity resets to seed
What changes
- Input
- none
- Output or change
- all rows of a table (or listed partitions)
Syntax at a glance
TRUNCATE TABLE { database_name.schema_name.table_name | schema_name.table_name | table_name } [ WITH ( PARTITIONS ( { <partition_number_expression> | <range> } [ , ...n ] ) ) ] [ ; ]
Work example
A disposable table must be emptied as a whole and its identity counter reset as documented.
Do not run this in a shared database. Compare DELETE and TRUNCATE rules for foreign keys, triggers, permissions, and transaction handling first.
Check your work TRUNCATE TABLE. The change plan names the exact table and confirms no row-level trigger or dependent foreign key is expected to run.
Open Microsoft Learn for full syntax, permissions, and details for your version.