how to import flat file source to database using sql

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

sql
sql-server
ssis
asked on Stack Overflow Jun 23, 2010 by newBie • edited Jun 23, 2010 by marc_s

3 Answers

3

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

answered on Stack Overflow Jun 23, 2010 by Brimstedt
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

answered on Stack Overflow Jun 23, 2010 by potatopeelings
1

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

answered on Stack Overflow Feb 11, 2014 by hellokuli • edited Feb 11, 2014 by Vasili Syrakis

User contributions licensed under CC BY-SA 3.0