> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Working with Truncate

> How to truncate a table.

This method is used to remove all records in a table. All records afterward are irrecoverable. It is extremely fast, dependent on table size.

<Danger>
  This will truncate the whole table, but won't delete the table itself.
</Danger>

## Truncate Examples

<Tabs>
  <Tab title="Agent RESTful API">
    ```csharp theme={null}
    using SuperOffice.WebApi;
    using SuperOffice.WebApi.Data;
    using SuperOffice.WebApi.Agents;

    // set up the DatabaseTable agent

    WebApiOptions options = //Get WebApiOptions with SystemUser Authorization
    DatabaseTableAgent dta = new DatabaseTableAgent(options);

    // table name

    string tableName = "y_rental";

    MassOperationResult massResult = await dta.TruncateAsync(tableName);

    if(massResult.Success)
    {
        Console.WriteLine($"Removed {massResult.Deletes} records from {tableName}.");
    }
    ```
  </Tab>

  <Tab title="Core API">
    ```csharp theme={null}
    using SuperOffice.Data.Dialect;

    var mo = MassOperations.GetCurrent();

    // table name

    string tableName = "y_rental";

    MassResult massResult = mo.Truncate(tableName);

    if(massResult.Success)
    {
        Console.WriteLine($"Removed {massResult.Deletes} records from {tableName}.");
    }
    ```
  </Tab>
</Tabs>


## Related topics

- [Truncate](/en/api/reference/restful/agent/databasetable_agent/truncate.md)
- [Working with Upsert](/en/api/bulk-operations/mass-operations/upsert.md)
- [SuperOffice.WebApi.Data.DatabaseTable TruncateRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.DatabaseTable_TruncateRequest.md)
- [SoTables.ini](/en/onsite/install/database/sotables-ini.md)
- [Working with Zaps](/integrations/zapier/howto/index.md)
- [Working with tiles](/en/dashboard/learn/working-with-tiles.md)
