SQL Server导入向导失败,包含难以理解的消息

Dav*_*vid 13 sql-server ssis sql-server-2005

我只想将平面文件中的两列导入到新表中.我已经设置了一列"代码",varchar(50)另一列是"描述" nvarchar(max).

导入失败,并显示以下消息:

- Executing (Error)
Messages
Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "Description" 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)

Error 0xc020902a: Data Flow Task 1: The "output column "Description" (14)" failed because truncation occurred, and the truncation row disposition on "output column "Description" (14)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
 (SQL Server Import and Export Wizard)

Error 0xc0202092: Data Flow Task 1: An error occurred while processing file "C:\Users\rinaldo.tempo\Desktop\ICD10_Edition4_CodesAndTitlesAndMetadata_GB_20120401.txt" on data row 3.
 (SQL Server Import and Export Wizard)

Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "Source - ICD10_Edition4_CodesAndTitlesAndMetadata_GB_20120401_txt" (1) returned error code 0xC0202092.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
 (SQL Server Import and Export Wizard)
Run Code Online (Sandbox Code Playgroud)

该错误消息向我建议数据被截断,因为它被放置在"描述"列中,这是类型nvarchar(max)!在对输入数据进行观察之后,我会说这些描述永远不会超过2或300个字符,所以这是不可能的.

有人能说出这里有什么不对吗?

Mar*_* N. 31

导入中字符串列的默认大小为50个字符.在数据进入数据库之前发生此截断.您应该在导入向导的第一步中在该Columns部分中进行调整.

  • 是,当您选择要导入的文件时,请单击"高级"选项卡.然后将故障字段扩展为8000或允许数据进入的任何内容(不能使用max).然后,当您进入"选择源表"页面时,如果要将其设置为"最大"(或可以保持原样),请单击"编辑映射"并在此处设置变量长度.这是向导自动在数据库中创建表时将使用的值. (2认同)