SQL Server导入表格
SQL Server导入表格
我试图将一个包含拉丁字符的表格上传到SQL Server,但是出现了以下错误信息。能有人帮我吗?
- 执行(错误)消息错误0xc02020a1:数据流任务1:数据转换失败。列“Description”的数据转换返回状态值4和状态文本“文本被截断或一个或多个字符在目标代码页中没有匹配”。 (SQL Server导入和导出向导)
- 错误0xc020902a:数据流任务1:因发生截断而导致“输出列“Description”(14)”失败,“输出列“Description”(14)”上的截断行处理方式指定了截断时的失败。发生了指定组件的指定对象的截断错误。 (SQL Server导入和导出向导)
- 错误0xc0202092:数据流任务1:在处理文件“C:\ Users \ rinaldo.tempo \ Desktop \ ICD10_Edition4_CodesAndTitlesAndMetadata_GB_20120401.txt”的数据行3时发生错误。 (SQL Server导入和导出向导)错误0xc0047038:数据流任务1:SSIS错误代码DTS_E_PRIMEOUTPUTFAILED。在组件“源 - ICD10_Edition4_CodesAndTitlesAndMetadata_GB_20120401_txt”(1)上调用PrimeOutput()方法返回错误代码0xC0202092。当管道引擎调用PrimeOutput()时,组件返回了一个失败代码。失败代码的含义由组件定义,但错误是致命的,管道停止执行。在此之前可能有更多关于失败的信息的错误消息。 (SQL Server导入和导出向导)
问题原因:在数据流任务中,字段Description被截断。可以增加该字段的大小。进入平面文件连接管理器,并在高级选项卡下增加字段的大小。默认值为50个字符。确保目标表和此值相同。如果尚不知道Description的最大大小,建议使用varchar(200)进行测试。
解决方法:增加字段的大小,确保与目标表一致。如果出现空值约束,需要检查该列是否允许空值。
错误信息:
- Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80004005 Description: "Unspecified error". (SQL Server Import and Export Wizard)
- Error 0xc020901c: Data Flow Task 1: There was an error with Destination - Products.Inputs[Destination Input].Columns[ProductID] on Destination - Products.Inputs[Destination Input]. The column status returned was: "The value violated the integrity constraints for the column.
- Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "Destination - Products.Inputs[Destination Input]" failed because error code 0xC020907D occurred, and the error row disposition on "Destination - Products.Inputs[Destination Input]" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure. (SQL Server Import and Export Wizard)
- Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Destination - Products" (38) failed with error code 0xC0209029 while processing input "Destination Input" (51). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure. (SQL Server Import and Export Wizard)
以上就是SQL Server导入表的问题出现的原因以及解决方法。