All Products
Search
Document Center

Lindorm:TRUNCATE TABLE

Last Updated:Mar 28, 2026

Removes all rows from a table while preserving its schema and indexes.

Applicable engines

LindormTable

Syntax

TRUNCATE TABLE table_identifier

Usage notes

  • SQL engine 2.6.10 or later: Run TRUNCATE TABLE directly.

  • SQL engine earlier than 2.6.10: Set the table to OFFLINE status using OFFLINE TABLE before running TRUNCATE TABLE.

TRUNCATE TABLE removes all row data but does not delete the table schema or indexes.

Examples

The following examples clear all data from the sensor table.

SQL engine 2.6.10 or later

TRUNCATE TABLE sensor;

SQL engine earlier than 2.6.10

-- Set the table to OFFLINE first.
OFFLINE TABLE sensor;

-- Clear all data from the table.
TRUNCATE TABLE sensor;