Skip to content

Added an option to escape delimiters in CSV files when using bulk copy#1312

Merged
ulvii merged 6 commits intomicrosoft:devfrom
ulvii:issue1173
May 26, 2020
Merged

Added an option to escape delimiters in CSV files when using bulk copy#1312
ulvii merged 6 commits intomicrosoft:devfrom
ulvii:issue1173

Conversation

@ulvii
Copy link
Copy Markdown
Contributor

@ulvii ulvii commented Apr 14, 2020

Fix for #1173

Adding SQLServerBulkCSVFileRecord.setEscapeColumnDelimitersCSV. When set to true, the following rules will apply.

  • Each field may or may not be enclosed in double quotes.
  • If fields are not enclosed with double quotes, then double quotes may not appear inside the fields.
  • Fields containing double quotes, and delimiters should be enclosed in double quotes.
  • If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote.

@ulvii ulvii added this to the 8.3.1 milestone Apr 16, 2020
@ulvii ulvii added the Public API Changes in Public API label May 9, 2020
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyCSVTest.java Outdated
Comment thread src/test/resources/BulkCopyCSVTestInputDelimiterEscape.csv Outdated
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCSVFileRecord.java Outdated
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCSVFileRecord.java Outdated
@ulvii ulvii merged commit 439737c into microsoft:dev May 26, 2020
@ulvii ulvii deleted the issue1173 branch May 26, 2020 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Public API Changes in Public API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants