diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java index 063dabe39..b1fc068ba 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java @@ -2056,7 +2056,7 @@ public int[] executeBatch() throws SQLServerException, BatchUpdateException, SQL localUserSQL = userSQL; try { - if (isInsert(localUserSQL) && connection.isAzureDW() && (this.useBulkCopyForBatchInsert)) { + if (this.useBulkCopyForBatchInsert && connection.isAzureDW() && isInsert(localUserSQL)) { // From the JDBC spec, section 9.1.4 - Making Batch Updates: // The CallableStatement.executeBatch method (inherited from PreparedStatement) will // throw a BatchUpdateException if the stored procedure returns anything other than an @@ -2201,7 +2201,7 @@ public long[] executeLargeBatch() throws SQLServerException, BatchUpdateExceptio localUserSQL = userSQL; try { - if (isInsert(localUserSQL) && connection.isAzureDW() && (this.useBulkCopyForBatchInsert)) { + if (this.useBulkCopyForBatchInsert && connection.isAzureDW() && isInsert(localUserSQL)) { // From the JDBC spec, section 9.1.4 - Making Batch Updates: // The CallableStatement.executeBatch method (inherited from PreparedStatement) will // throw a BatchUpdateException if the stored procedure returns anything other than an