newBie
newBie

Reputation: 39

how to import flat file source to database using sql

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?..

Upvotes: 1

Views: 7762

Answers (3)

hellokuli
hellokuli

Reputation: 11

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

Upvotes: 1

potatopeelings
potatopeelings

Reputation: 41075

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

Upvotes: 2

Brimstedt
Brimstedt

Reputation: 3140

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

Upvotes: 3

Related Questions