Hello, I need to loop through table a and insert into table b get the SCOPE_IDENTITY() and use that to insert more data from table a into table c using the SCOPE_IDENTITY() .
table a is a flat table with company and worker information.
table b will become company table
table c will become worker table using company.Id(SCOPE_IDENTITY() ) as worker.companyId.
What is the best way to do this type of statement?