Delete specific rows from Azure Table Explorer

Ancy 6 Reputation points
2021-05-31T07:59:58.327+00:00

Hi Team,

We want to delete specific rows from Azure Storage Explorer table. The rows we want to delete are not based on Partition Key or Row Key. They are based on some other filtering criteria for other column of the table i.e created on date

Can anyone from the team help us with this query?

Thank You

Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
162 questions
Azure Storage Explorer
Azure Storage Explorer
An Azure tool that is used to manage cloud storage resources on Windows, macOS, and Linux.
240 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. deherman-MSFT 35,011 Reputation points Microsoft Employee
    2021-06-01T17:51:09.08+00:00

    @Ancy
    Timestamp is one of the fields that can be used to filter when doing your query. Does this resolve your issue? If not can you give me an example of how you are trying to filter the table?

    101410-table-query.png

    -------------------------------

    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

  2. sadomovalex 3,631 Reputation points
    2021-06-07T15:05:22.063+00:00

    something like that:

    var query = new TableQuery<MyEntity>().Where(TableQuery.GenerateFilterCondition("MyField", QueryComparisons.Equal, "Foo"));
    var rows = groupsTable.ExecuteQuery(query);
    foreach (var row in rows)
    {
        var tableOperation = TableOperation.Delete(row);
        table.Execute(tableOperation);
    }
    

    Note however that since querying is done by custom field (MyField) it will cause full table scan to find all rows which match specified condition. Depending on table size it may be quite slow. Only query by PartitionKey and RowKey are fast because they are only system indexed columns in Azure storage.

    0 comments No comments