Skip to content

Commit 309faaf

Browse files
committed
User Story 34145: Tidy up Bulk Copy unmatched column name work
- Addressed review comments.
1 parent eac2cd9 commit 309faaf

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,8 @@ private string AnalyzeTargetAndCreateUpdateBulkCommand(BulkCopySimpleResultSet i
578578

579579
// Are we missing a mapping between the result column and
580580
// this local column (by ordinal or name)?
581-
if (! (localColumn._destinationColumnOrdinal == metadata.ordinal
582-
|| UnquotedName(localColumn._destinationColumnName) == metadata.column))
581+
if (localColumn._destinationColumnOrdinal != metadata.ordinal
582+
&& UnquotedName(localColumn._destinationColumnName) != metadata.column)
583583
{
584584
// Yes, so move on to the next local column.
585585
continue;
@@ -596,7 +596,7 @@ private string AnalyzeTargetAndCreateUpdateBulkCommand(BulkCopySimpleResultSet i
596596
//
597597
// We will not process timestamp or identity columns.
598598
//
599-
if ((metadata.type == SqlDbType.Timestamp)
599+
if (metadata.type == SqlDbType.Timestamp
600600
|| (metadata.IsIdentity && !IsCopyOption(SqlBulkCopyOptions.KeepIdentity)))
601601
{
602602
rejected = true;

src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,8 @@ private string AnalyzeTargetAndCreateUpdateBulkCommand(BulkCopySimpleResultSet i
613613

614614
// Are we missing a mapping between the result column and
615615
// this local column (by ordinal or name)?
616-
if (! (localColumn._destinationColumnOrdinal == metadata.ordinal
617-
|| UnquotedName(localColumn._destinationColumnName) == metadata.column))
616+
if (localColumn._destinationColumnOrdinal != metadata.ordinal
617+
&& UnquotedName(localColumn._destinationColumnName) != metadata.column)
618618
{
619619
// Yes, so move on to the next local column.
620620
continue;
@@ -631,7 +631,7 @@ private string AnalyzeTargetAndCreateUpdateBulkCommand(BulkCopySimpleResultSet i
631631
//
632632
// We will not process timestamp or identity columns.
633633
//
634-
if ((metadata.type == SqlDbType.Timestamp)
634+
if (metadata.type == SqlDbType.Timestamp
635635
|| (metadata.IsIdentity && !IsCopyOption(SqlBulkCopyOptions.KeepIdentity)))
636636
{
637637
rejected = true;

0 commit comments

Comments
 (0)