0

I'm trying to import a flat file into SQL Server and I'm having some issues. The column delimiter is ;~ and the row delimiter is |~. I'm using the SQL Server Import and Export Wizard but keep getting errors. Have any of you every had a similar issue? I think I'm doing it wrong from the start of the wizard. Can any of you talk me through the steps. Thanks.

Here is the import error:

enter image description here

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 1
    Please add what errors your are getting. A screenshot or description will suffice. – Matt Mar 23 '16 at 23:01
  • If you are comfortable with SSIS, use it. A workaround is converting the text file to a TAB delimiter text, by writing a simple program (or a utility program). – FLICKER Mar 23 '16 at 23:06
  • Can you check if you have any special characters in the file - specifically in the column `uniqueId`. The error message says it is not able to match some characters in the code page of the target. Also, in the Edit Mappings section, check that the type and size of the columns match to ensure there are no truncation errors. – Amit Sukralia Mar 23 '16 at 23:26

2 Answers2

0

It's a familiar-sounding problem, but difficult to be sure without a data file to play with - perhaps one of these posts has your answer:

Text was truncated or one or more characters had no match in the target code page including the primary key in an unpivot

Errors in SQL Server while importing CSV file despite varchar(MAX) being used for each column

SQL Server Import wizard fails with incomprehensible message

Community
  • 1
  • 1
0

Thanks to all of you who responded.

My solution was to first create the tables in SQL Server using the varchar(max) data type for each column and then executing a BULK INSERT statement. Definitely not ideal, but the goal was not to create a database but rather delimit the data so I could upload it to an application. Thanks again.