0

I have a problem with a SQL import from a CSV file that contains a text qualifier = "¬¬" i.e. only the part between the inverted commas. When I use the SQL Server Management Studio import tool I set the following:

Import wizard

The preview (all looks good - the way I would like it to import): enter image description here

The output after the import (the problem):

enter image description here

This is what it replaces the text qualifier with: "¬¬"

I would appreciate any ideas on how to correct this issue thanks.

TT.
  • 15,774
  • 6
  • 47
  • 88
Matt
  • 149
  • 3
  • 14
  • Are you sure the code page is correct? – TT. Sep 12 '17 at 11:20
  • I have not edited the code page. I thought that the tool would have automatically identified the encoding of the CSV? – Matt Sep 12 '17 at 11:23
  • [You can't detect the codepage, you need to be told it](https://stackoverflow.com/a/90956/243373). That is not to say that what you chose is incorrect, I was just wondering whether it is since some characters are converted incorrectly. – TT. Sep 12 '17 at 11:25
  • Okay so if I am exporting from a SAP environment to CSV using the R2 connector tool do you perhaps know how I can tell the code page information? – Matt Sep 12 '17 at 11:27
  • I do not know sorry. The environment should document that or the tool you use should, or uses options that should tell you this. – TT. Sep 12 '17 at 11:29
  • Maybe check the page I linked to for answers that try to guess/determine it. Maybe Notepad++ can be useful for this. – TT. Sep 12 '17 at 11:32
  • According to notepad the encoding is UTF-8-BOM - never heard of this format. Will have a look and post an update should I come right. Thanks for your input. – Matt Sep 12 '17 at 11:34

1 Answers1

0

It seems that SSMS does not like the "¬¬" text qualifier for reasons unknown (perhaps relating to the encoding standard) and I found it easier to find and replace the qualifier with "^^^" using Notepad++. After importing the files again, the new qualifier worked without any further issues.

--Update-- Not sure why this did not seem as obvious before however using the odd output "¬¬" as the text qualifier solved this problem even better! Bear in mind that the preview text output using the import wizard will appear as being incorrect however the final output reflects correctly!

Matt
  • 149
  • 3
  • 14