This is pseudo code, but you should be able to get the idea from here…
Will develop more as requested…
DECLARE @t TABLE (Columns Def, repeat ...) insert into @t select from flat_file insert into parent select parent, fields from @t insert into child select p.parentid, c.child, c.fields from @t c inner join parent p on c.parentkey = p.parentkey
Leave a Reply