l******9 发帖数: 579 | 1 【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: Truncation error import csv file to SQL table
发信站: BBS 未名空间站 (Wed Apr 29 15:28:46 2015, 美东)
I would like to import a .csv file into a SQL Server 2008R2 database table
on Win 7.
It has one column and one row.
File1:
name
runeocnu 430274 sjunosnv djduenvop 934m ljfonm3
I got error:
Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data
conversion for column "NAME" returned status value 4 and status text "Text
was truncated or one or more characters had no match in the target code page
.".
(SQL Server Import and Export Wizard)
I have created the destination table
CREATE TABLE my_tbl
(
[NAME] [varchar](1024) NULL
) ON [PRIMARY]
The data column width is large enough to hold the string. Why still got the
truncation error ?
But, if I used SQL query "insert into" in SQL Server Management Studio, it
worked well.
Also, in the import wizard, in colum mappings window, the source column is
NAME string [DT_STR] (50)
It should be 1024 ?
Any help would be appreciated. | l*******d 发帖数: 204 | 2 烙印?
【在 l******9 的大作中提到】 : 【 以下文字转载自 Database 讨论区 】 : 发信人: light009 (light009), 信区: Database : 标 题: Truncation error import csv file to SQL table : 发信站: BBS 未名空间站 (Wed Apr 29 15:28:46 2015, 美东) : I would like to import a .csv file into a SQL Server 2008R2 database table : on Win 7. : It has one column and one row. : File1: : name : runeocnu 430274 sjunosnv djduenvop 934m ljfonm3
|
|