Skip to content

Commit

Permalink
0002456: Use unicode for bulk insert file on SQL-Server
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Nov 25, 2015
1 parent 4fe95cd commit a2d7ed9
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -216,7 +216,7 @@ protected void flush() {
String sql = String.format("BULK INSERT " +
this.getTargetTable().getQualifiedTableName(quote, catalogSeparator, schemaSeparator) +
" FROM '" + filename) + "'" +
" WITH ( FIELDTERMINATOR='"+StringEscapeUtils.escapeJava(fieldTerminator)+"', KEEPIDENTITY" +
" WITH (DATAFILETYPE='widechar', FIELDTERMINATOR='"+StringEscapeUtils.escapeJava(fieldTerminator)+"', KEEPIDENTITY" +
(fireTriggers ? ", FIRE_TRIGGERS" : "") + rowTerminatorString +");";
Statement stmt = c.createStatement();

Expand All @@ -242,4 +242,4 @@ protected void createStagingFile() {
table.getName() + this.getBatch().getBatchId() + ".csv");
}

}
}

0 comments on commit a2d7ed9

Please sign in to comment.