This may be obvious, but I've been banging my head for a while... please point me in the direction of an article if there is one.
I'm importing a series of Excel files into a SQL database.
They will have a list of text items with a value:
Name | Value
----------------
Name1 | 100
Name2 | 140
Name3 | 200
The target database has a lookup table of "Name" mappings.
What I want to do is find a corresponding NameID for a row, and put that into a column (this is the easy part), however, if there is no corresponding entry in the Name table it should insert the row and get the new ID.
Is there an accepted way to do this? I'm looking at low volumes, so I don't need it to be particularly performant, just simple and easy to follow.
Name3
does not exist in the reference/lookup table. Is it possible thatName3
would appear multiple times in the same Excel spreadsheet?