I have a CSV file in following format which I wish to import in SQL table.
I have a working solution for a straight CSV like
header
Column
Rows
footer
But now I want to import following structure
header
Column
Rows
footer
header
Column
Rows
footer
header
Column
Rows
footer
header
Column
Rows
footer
I have also created a format file but it doesn’t help as each section belongs to a separate table in the SQL database.
I’m using SQL 2008 R2.
Please help regarding this as I can’t see any light.
The issue is solved now.
I have created a stored procedure which extracts all data in single column and then loops it in CTE to split the data.
The stored procedure is somewhat huge to post it here, but if anyone wants it I can provide sample file and procedure.