Add text when using SQLBulkCopy in SQL Server from excel
1 answer
Since the sheet name does not change, I solved it this way:
-
Created a temporary table with the same layout as final.
-
Imported data from the first sheet into a temporary table.
-
Populated a column that was now null with the correct value.
-
Made nr 2-> 3 for next sheet until all sheets are imported.
-
Checks the temporary table for errors.
-
I imported the data from the temporary table into the summary table one row at a time to be able to determine if records exist and if it is an update and also insert them.
0
source to share