Reputation: 395
I would need a way to know the most efficient way to see if a table in azure storage has any data
Exemple
cloudTable.ExecuteQuery("what do i do");
Thanks for the suggestions! I finally did something like this:
var query = new TableQuery<T>()
{
TakeCount = 1,
SelectColumns = new List<string>()
{
"PartitionKey"
}
};
var table = await this.GetTableAsync();
var segment = await table.ExecuteQuerySegmentedAsync(query, null);
return segment.Results.Any();
Upvotes: 0
Views: 845
Reputation: 62213
You could do this which limits your query to 1 record if there is data.
// select value = take smallest data field to avoid returning everything for a record
var query = new TableQuery().Select(new List<string>(){"smallcolumn"}).Take(1);
Upvotes: 2