I've 'inherited' some code that I am having a hard time working with. The application has an excel import function to import members to a members table, and SqlBulkCopy
is used.
A few months ago a junction table was added and two of the attributes in the members table has to be added there as well for the application to work properly. There are no hard coupling (no PK, FK - not my choice!).
I am not sure how to solve this, because as far as I know you can't bulkcopy to two tables, you will have to do it separately. But how can I retrieve the GUID attribute of the newly imported members as well as the other attribute values (groupId) in the best way (low impact on performance)?
Example:
Excel-import:
Name
Email
plus more
Table 1
name
personID (GUID)
groupID (same for all imported members)
+ other attributes
Table2
personID (GUID)
groupID (same for all imported members)
+ other 'new' attributes
Sorry I can't provide any code this time :/ Really hope somebody can give me any advice!