This guy's post history is amazing. Literally 12 years of occasionally logging in to ask for help with one thing or another. I'm not sure why I find this so interesting, but I do.
Anyway, yeah, easiest way is to build a dictionary/map, then you can insert all the rows in to your DB once you have your set build.