---
url: /process-functions/table-truncate.md
description: Removes all rows from a table in the model.
---

# table.truncate

Removes all rows from one of the model's [tables](/technical/tables), keeping its fields. To remove the table as well, use [table.delete](/process-functions/table-delete).

::: tip
For more control, such as other column types, indexes or keys, manage tables with SQL instead. Run `CREATE`, `ALTER` and `DROP TABLE` statements with [DatasourceClient](/process-functions/datasourceclient)'s `execute`.
:::

```js
table.truncate(tableName)
```

## Parameters

| Parameter | Type | Description |
|---|---|---|
| `tableName` | `string` | The table's name or id. |

## Returns

`true` if the table was emptied, `false` if it can't be found.

## Examples

```js
const removed = table.truncate("users");
```

## Related

* [table.delete](/process-functions/table-delete)
