All Products
Search
Document Center

Tablestore:Delete data tables

Last Updated:Jul 23, 2024

You can call the DeleteTable operation to delete a data table from an instance.

Usage notes

  • You cannot restore deleted data tables. Proceed with caution.

  • When you delete a data table, the data in the data table and the secondary indexes that are created for the data table are deleted. You cannot restore deleted data or secondary indexes. Proceed with caution.

Prerequisites

API operation

/**
 * Delete a specific table from the instance. 
 */
deleteTable(params, callback)  

Parameters

Parameter

Description

tableName

The name of the data table.

Example

The following sample code provides an example on how to delete a data table:

var client = require('./client');

var params = {
    tableName: 'sampleTable'
};

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

References

  • For more information about the API operation, see DeleteTable. For the complete sample code, visit DeleteTable@GitHub.

  • If an error occurs when you call this operation, search for the error cause in Error codes based on the error message and troubleshoot the error.