Skip to content

Commit

Permalink
BCP Incorrect condition? #318
Browse files Browse the repository at this point in the history
  • Loading branch information
Cinchoo committed Jun 7, 2024
1 parent 20f580a commit e780f12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ChoETL/Common/ChoUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2251,8 +2251,9 @@ private static void Bcp(this IDataReader dr, SqlBulkCopy bcp, string tableName,
};
}

if (columnMappings == null || columnMappings.Count == 0)
if (columnMappings != null && columnMappings.Count > 0)
{
bcp.ColumnMappings.Clear();
foreach (KeyValuePair<string, string> keyValuePair in columnMappings)
bcp.ColumnMappings.Add(keyValuePair.Key, keyValuePair.Value);
}
Expand Down

0 comments on commit e780f12

Please sign in to comment.