0

I've had a reoccurring issue when importing csv/xlsx files that have a text field with a text length in the 300's or larger. For example in my file, Linkedin URLs which can get very lengthy. However, no matter what length I set the destination field to on import (400/MAX ect...) I always get a truncation error. I have seen workarounds like sorting the excel sheet by using a LEN() function and taking out the largest rows, but I need to maintain all of this data so this really isn't a good option. Is there any way to fix this? I haven't really seen anything explaining why this won't work.

enter image description here

OhioMike1987
  • 125
  • 1
  • 1
  • 10
  • Issues like this are why I prefer to use BULK INSERT instead of the wizard... – squillman Apr 13 '18 at 16:26
  • Agreed. Unfortunately in my current role I don't have permission. – OhioMike1987 Apr 13 '18 at 16:28
  • 1
    Bummer. In the `Select Source Tables and Views` step of the wizard, edit the mappings for each column and make sure the destination columns are the right type and the size is large enough to hold the data. The wizard is notoriously bad at discerning those. – squillman Apr 13 '18 at 16:31
  • You might actually have troublesome characters buried in the data, invoking that "no match in the target code page" clause of the error message. But this answer looks promising: https://stackoverflow.com/questions/18600040/errors-in-sql-server-while-importing-csv-file-despite-varcharmax-being-used-fo – Eric Brandt Apr 13 '18 at 18:54

0 Answers0