Skip to content

Commit

Permalink
PR review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Virtanen Riku committed Feb 5, 2025
1 parent 3f2cf96 commit 9eea415
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,9 @@ private static async Task<long> ExecuteHandler(Options options, Input input, Dat
{
var rowsCopied = 0L;


if (input.ColumnMapping == ColumnMapping.JsonPropertyOrder)
{
// ColumnMapping.JsonPropertyOrder is default and is already being handled by SqlBulkCopy.
}
else if (input.ColumnMapping == ColumnMapping.JsonPropertyNames)
// JsonPropertyOrder is handled implicitly (default behavior) by not adding any column mappings,
// which means the columns will be mapped based on their order in the input JSON.
if (input.ColumnMapping == ColumnMapping.JsonPropertyNames)
{
foreach (var column in dataSet.Tables[0].Columns)
sqlBulkCopy.ColumnMappings.Add(new SqlBulkCopyColumnMapping(column.ToString(), column.ToString()));
Expand Down

0 comments on commit 9eea415

Please sign in to comment.