From e780f12632e52d839b80f54fba035556cb97faa7 Mon Sep 17 00:00:00 2001 From: Cinchoo Date: Fri, 7 Jun 2024 11:59:26 -0400 Subject: [PATCH] BCP Incorrect condition? #318 --- src/ChoETL/Common/ChoUtility.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ChoETL/Common/ChoUtility.cs b/src/ChoETL/Common/ChoUtility.cs index 078b2b50..a75ea7a1 100644 --- a/src/ChoETL/Common/ChoUtility.cs +++ b/src/ChoETL/Common/ChoUtility.cs @@ -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 keyValuePair in columnMappings) bcp.ColumnMappings.Add(keyValuePair.Key, keyValuePair.Value); }