All Products
Search
Document Center

Tablestore:Delete a data table

Last Updated:Jun 25, 2025

This topic describes how to delete a data table from an instance by using Tablestore SDK for Node.js.

Usage notes

  • If a search index is created for a data table, you must delete the search index before you delete the data table.

  • If a secondary index is created for a data table, the secondary index is automatically deleted when you delete the data table.

  • You cannot restore deleted data tables or secondary indexes. Proceed with caution.

Prerequisites

A client is initialized. For more information, see Initialize a Tablestore client.

Method description

deleteTable: function deleteTable(params, callback)

params parameter description

tableName (required) string: the name of the data table.

Sample code

The following sample code demonstrates how to delete a data table named test_table.

var params = {
    tableName: 'test_table'
};

client.deleteTable(params, function (err, data) {
    if (err) {
        console.error('error:', err);
        return;
    }
    console.log('success:', data);
});