1

im currently want to inport my data from flat file to the database.

the flat file is in a txt file. in that txt file, i save a list of URLs. example:

http://www.mimi.com/Hotels-g303188-Rurrenabaque-Hotels.html

im using the SQL Server Import and Export wizard to do it. but when the time of execution, it has error saying

Error 0xc02020a1: 
Data Flow Task 1: Data conversion failed. The data conversion for column 
"Column 0" returned status value 4 and status text "Text was truncated or one 
or more characters had no match in the target code page.".

can anyone help?..

0

3 Answers 3

3

You get this error because the text is too long for the column youve chosen to put it in.

Sign up to request clarification or add additional context in comments.

2 Comments

Make the column larger: ALTER your TABLE and put assign more characters for the column (eg VARCHAR(32) to VARCHAR(255)) or put another column type (eg TEXT)
and on the import data wizard, also make sure to select a length that is long enough for your data contents - it often tends to default to 30 or 60 characters or something which might be too short for your text
2

Text was truncated or

You might want to check the size of the database column vis-a-vis your input data. Does the longest URL less than the column width?

one or more characters had no match in the target code page.".

Check if your input file has any special characters. An easy way to check this would be to save your file in ANSI (Notepad > Save As > Encoding = ANSI). Note - you'd still have to select the right code page so that the import interprets your input text correctly.

Here's a very nice link that has some background on what code pages are - http://www.joelonsoftware.com/articles/Unicode.html

Comments

1

Note you can also change the target column data type (to text stream for example) in the Datasource->Advanced section

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.