I'm trying to load a flat file that has header information and multiple detail lines on the same line into a SQL Server table.
It's fixed width data file. I'm interested in loading H2 and all the Dx_2 columns found.
There can be many (200+) detail groups. The goal is to put this header/details into a single database row.
Larry has 2 detail values, Moe has 1, Curly has 3, and Shemp has 0. Shemp does not need to be loaded since he has 0 detail.
H1 | H2 | H3 | D1_1 | D1_2 | D1_3 | D2_1 | D2_2 | D3_3 | D3_1 | D3_2 | D3_3 |
Larry | 4 | 1 | |||||||||
Moe | 2 | ||||||||||
Curly | 5 | 2 | 5 | ||||||||
Shemp |
How can I pull the header and all the details programatically?
Thanks
___
jcs
Jack