I have a db table (Contacts) whose contents are refreshed with new/updated data periodically. The table has an ident primary key, but it is rather worthless to use as a foreign key because the keys change everytime the data is refreshed. (wipe and reinserted)
For example, contact Joe Smith may have ID 7, but after a refresh could have ID 834678. Consequently, any table that needs to hold a foreign key to Joe Smith's contact record must use a composite key of sorts.
We are using "UniqueID" (string value) and "AccountID" (int value) to uniquely identifiy a contact. "UniqueID" *should* be unique within the context of a given "AccountID".
Because of varying data sources, Joe Smith could potentially have multiple records, each with the same "UniqueID" and "AccountID". So I'm dealing with a collection of contacts that should be identified by a faux (defined) composite key.
I'm a bit baffled as to how I can represent this collection to NH. Any ideas would be HUGELY appreciated.
Thanks,
John
|