Charles F
Charles F

Reputation: 114

How to test for field existence in Azure Table Storage query

I'm facing an interesting question, I had to run a datamigration script yesterday in order to add a field to entries in a Azure table. The script crashed just next to the end of its execution, and I have now 50 of my entries which need to be added this field (namely "OrganizationName").

I'd like to select only these entries, but running this query in Cloud Storage Studio does not return anything:

(OrganizationName eq '')

In C# I have the same result (empty list):

var query = from user in _tableService.GetDataContext().AppUserEntity
                    where 1 == 1 && user.OrganizationName == ""
                    select user;

List<AppUserEntity> list = query.ToList();

I suppose that makes sense, as my entities don't have the field, its value cannot be String.empty. But I'm wondering of an efficient way to retrieve these entries other than just retrieving everything and looping, and found nothing satisfying anywhere.

Any ideas?

(PS: I'm running SDK 1.8, which also might be part of the problem)

Upvotes: 0

Views: 365

Answers (1)

hocho
hocho

Reputation: 1749

It may be possible to query on 'Timestamp' to get the rows which were skipped being updated when your script crashed.

Upvotes: 1

Related Questions