I have below tables structure where it has one to many mappings
CREATE TABLE #Primary(PrimaryId int,ItemName varchar(10)) CREATE TABLE #Sub1(PrimaryId int,Sub