Thank you for the reply but I'm still a bit confused about one part.
There is an index:
CREATE UNIQUE NONCLUSTERED INDEX [IX_SyncMapping_BySource] ON [dbo].[SyncMapping]
(
[SourceKey] ASC,
[EntityName] ASC,
[ContextName] ASC
)
If I setup according to your plan:
- ContextName: MyPluginName
- EntityName: Product
- SourceKey: null (I am just saving extraneous data about the product and there is no link)
- EntityID: ProductID
This would cause duplicates because there all products would have the same value for ContextName, EntityName, SourceKey. It seems like I don't have any choice but to make SouceKey = ProductID.
And in my case I need to save multiple extra fields for one product so either I have to change EntityName to be the fieldname or I would get duplicates on just one product. I could do SourceKey = ProductID + FieldName but then I would have to parse it out.
Thoughts?
Thanks