---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.4
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/truncate-table.md
  - https://ydb.tech/docs/ru/yql/reference/syntax/truncate-table.md
sourcePath: en/core/yql/reference/syntax/truncate-table.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# TRUNCATE TABLE

`TRUNCATE TABLE` removes all user data from the specified table and its indexes.

## Syntax

```yql
TRUNCATE TABLE <table_name>;
```

## Limitations

* Supported only for [row-oriented tables](https://ydb.tech/docs/en/concepts/glossary.md#row-oriented-table).
* While the operation runs, the table is locked for reads and writes.
* The operation cannot be interrupted or canceled after it has started.
* The operation cannot be performed if the table has:
    - an [asynchronous secondary index](https://ydb.tech/docs/en/concepts/query_execution/secondary_indexes.md#async),
    - a [changefeed](https://ydb.tech/docs/en/yql/reference/syntax/alter_table/changefeed.md),
    - [asynchronous replication](https://ydb.tech/docs/en/concepts/async-replication.md).

## Examples

Removes all data from the table with the full path `/Root/test/my_table`.

```yql
TRUNCATE TABLE `/Root/test/my_table`;
```

Removes all data from table `my_table` in the current database.

```yql
TRUNCATE TABLE `my_table`;
```

## See also

* [CREATE TABLE](https://ydb.tech/docs/en/yql/reference/syntax/create_table/index.md)
* [ALTER TABLE](https://ydb.tech/docs/en/yql/reference/syntax/alter_table/index.md)
* [DROP TABLE](https://ydb.tech/docs/en/yql/reference/syntax/drop_table.md)
