Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you already know the PartitionKey and RowKey of an entity you don't have to load it first. The fastest way is to use the CloudTable directly and a <a href="http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storage.table.dynamictableentity.aspx">DynamicTableEntity</a> like this:</p> <pre><code>var cloudTable = cloudTableClient.GetTableReference("TheTable"); var entity = new DynamicTableEntity("ThePartitionKey", "TheRowKey"); entity.ETag = "*"; cloudTable.Execute(TableOperation.Delete(entity)); </code></pre> <p>If you want to delete a collection of entities which you don't know the RowKeys then you will need to load the entities first and use a <a href="http://www.windowsazure.com/en-us/develop/net/how-to-guides/table-services/#header-8">Batch Operation</a> to delete the entities. Also, you don't need to load all properties of the entities, we just need to know the RowKey so we can again use the same technique as above. For that we use a <a href="http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-tables/#query-a-subset-of-entity-properties">Projection Query</a> </p> <pre><code>var batchOperation = new TableBatchOperation(); // We need to pass at least one property to project or else // all properties will be fetch in the operation var projectionQuery = new TableQuery&lt;DynamicTableEntity&gt;() .Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "ThePartitionKey")) .Select(new string[] { "RowKey" }); foreach (var e in table.ExecuteQuery(projectionQuery)) batchOperation.Delete(e); table.ExecuteBatch(batchOperation); </code></pre> <p><strong>A word of caution</strong>: a <em>Batch Operation</em> allows a maximum 100 entities in the batch which must share the same PartitionKey so you may need to split the entities into proper batches for this to work.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload