从Excel导入数据到SQL时出错 [英] Error in importing data from excel to sql

查看:299
本文介绍了从Excel导入数据到SQL时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于所有数据库天才,
希望您可以将导入Excel文件到SQL Server 2005时遇到的错误对我有所帮助.

这是错误:

To all database genius out there,
I hope you can help me with this error I encountered when importing excel file to SQL Server 2005.

This is the error:

Executing (Error)
Messages
Error 0xc020901c: Data Flow Task 1: There was an error with output column "Description" (21) on output "Excel Source Output" (9). The column status returned was: "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" (21)" failed because truncation occurred, and the truncation row disposition on "output column "Description" (21)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
 (SQL Server Import and Export Wizard)
Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "Source - 'Data $'" (1) returned error code 0xC020902A.  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)



幸运的是,我暗示了问题所在:这是因为excel中的数据类型只能容纳nvarchar 255,而在导入时,它超出了nvarchar 255,并且包含特殊字符,例如:'',;;.和汉字.
问题是,我用光了解决方案.
预先感谢您的帮助.
感谢.



Luckily I have a hint what the problem is all about : It is because data type in excel can only accommodate nvarchar 255, and when I import it, it is beyond nvarchar 255, and that it contains special characters like : '',; and chinese characters.
The thing is, I ran out of solutions.
Thank you in advance for those who will help.
Appreciate it.

推荐答案

'"(错误代码0xC020902A.当管道引擎称为PrimeOutput()时,该组件返回了故障代码 由组件定义,但是 是致命的,并且管道停止执行.可能存在错误之前发​​布的有关该失败的更多信息的span>消息. (SQL Server导入导出向导)
'" (1) returned error code 0xC020902A. 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)



幸运的是,我暗示了问题所在:这是因为excel中的数据类型只能容纳nvarchar 255,而在导入时,它超出了nvarchar 255,并且包含特殊字符,例如:'',;;.和汉字.
问题是,我用光了解决方案.
预先感谢您的帮助.
谢谢.



Luckily I have a hint what the problem is all about : It is because data type in excel can only accommodate nvarchar 255, and when I import it, it is beyond nvarchar 255, and that it contains special characters like : '',; and chinese characters.
The thing is, I ran out of solutions.
Thank you in advance for those who will help.
Appreciate it.


文本被截断当导入列的字符数超过表中允许的字符数时,SQL中就会发生错误.例如,具有dattype nvarchar(50)的列集不能容纳长度超过50个字符的文本.

将您的数据与表设计进行比较,并根据需要修改表或数据.如果您对数据的长度不满意,请将表数据类型设置为nvarchar(max),它应该可以工作.
Text was truncated error in SQL occurs when the import column has more characters than allowed in the table. For exaqmple a column set with dattype nvarchar(50) cannot accommodate text longer then 50 characters long.

Compare your data to the table design and either ament the table or the data as necessary. If you are unsy=ure of the length of your data set the table datatype to nvarchar(max) and it should work.


这篇关于从Excel导入数据到SQL时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆