截断错误从Excel导入SQL Server 2005 [英] Truncation errors importing to SQL Server 2005 from Excel

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

问题描述

长篇小说,我一个接一个地使用一组excel文档,并使用导入/导出向导将它们导入SQL Server 2005中的数据库。

Long story short, I'm taking a bunch of excel documents one by one, and importing them using the Import/Export wizard into a database in SQL Server 2005.

这是一个报告(所有进程未显示为成功)。有没有办法忽略截断错误?我已经googled了无济于事,或至少不在我的版本。

Here's one report (all processes not shown are a "Success"). Is there any way for me to ignore truncation errors? I've googled around to no avail, or at least not in my version.


- Executing (Success)

- Copying to [Datadev].[dbo].[Sheet0$] (Error)
  Messages
  * Error 0xc020901c: Data Flow Task: There was an error with output

列值含义说明
(234)输出Excel源输出
(9)。返回的列状态为:
文本被截断,或者一个或多个
字符在目标
代码页中没有匹配。
(SQL Server导入和导出向导)

column "Value Meaning Description" (234) 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: The "output column "Value

含义说明(234)失败
,因为截断发生,$ b $ 截断行处理在
列输出值含义描述
(234)指定
截断失败。在指定的组件的
的指定对象上发生截断错误

(SQL Server导入和导出向导)

Meaning Description" (234)" failed because truncation occurred, and the truncation row disposition on "output column "Value Meaning Description" (234)" 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: SSIS Error Code

DTS_E_PRIMEOUTPUTFAILED。
组件
上的PrimeOutput方法Source - Sheet0 $(1)返回错误
代码0xC020902A。当
管道引擎称为PrimeOutput()时,组件
返回失败代码。
故障代码的含义是由组件定义的
,但
错误是致命的,并且管道
停止执行。可能会有错误
消息之前发布更多
有关失败的信息。
(SQL Server导入和导出向导)

DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source - Sheet0$" (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)

  * Error 0xc0047021: Data Flow Task: SSIS Error Code

DTS_E_THREADFAILED。线程
SourceThread0已退出错误
代码0xC0047038。可能有错误
消息之前发布更多
信息为什么线程
退出。
(SQL Server导入和导出向导)

DTS_E_THREADFAILED. Thread "SourceThread0" has exited with error code 0xC0047038. There may be error messages posted before this with more information on why the thread has exited. (SQL Server Import and Export Wizard)

  * Error 0xc0047039: Data Flow Task: SSIS Error Code

DTS_E_THREADCANCELLED。线程
WorkThread0收到关闭
信号并正在终止。用户
请求关闭,或
中的错误另一个线程导致管道
关闭。可能有错误
消息之前发布更多
信息为什么线程
被取消。
(SQL Server导入和导出向导)

DTS_E_THREADCANCELLED. Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown. There may be error messages posted before this with more information on why the thread was cancelled. (SQL Server Import and Export Wizard)

  * Error 0xc0047021: Data Flow Task: SSIS Error Code

DTS_E_THREADFAILED。线程
WorkThread0退出错误
代码0xC0047039。可能有错误
消息之前发布更多
信息为什么线程
退出。
(SQL Server导入和导出向导)

DTS_E_THREADFAILED. Thread "WorkThread0" has exited with error code 0xC0047039. There may be error messages posted before this with more information on why the thread has exited. (SQL Server Import and Export Wizard)

- Post-execute (Success)
  Messages
  * Information 0x402090df: Data Flow Task: The final commit for the

数据插入的最终提交已启动。
(SQL Server导入和导出向导)

data insertion has started. (SQL Server Import and Export Wizard)

  * Information 0x402090e0: Data Flow Task: The final commit for the

数据插入已结束。
(SQL Server导入和导出向导)

data insertion has ended. (SQL Server Import and Export Wizard)

- Cleanup (Success)
  Messages
  * Information 0x4004300b: Data Flow Task: "component "Destination -

Sheet0 $(323) 210行。
(SQL Server导入和导出向导)

Sheet0$" (323)" wrote 210 rows. (SQL Server Import and Export Wizard)


推荐答案

向导使用较小的值作为Excel数据的标准varchar大小,而不是SQL Server 2000中向导中的varchar大小。因此,它通常会截断您尝试快速导入到临时表的数据。但是,当您执行该向导时,一个屏幕会询问您是否要编辑映射,并且可以修复这些字段的大小。或者您可以先创建表格,以创建一个具有所需大小的工作表(如果您是第一次查看数据,那么nvarchar(max)很好,并且不知道这些字段的大小),然后导入进去。使用Excel,我知道我也有SQL服务器的问题只使用几行来确定数据类型,然后插入失败的记录(例如像partnumber一样),因为它认为基于前几个记录它是一个整数,当它真的是字符串类型的数据。你也可能会遇到这样的问题,所以即使没有收到截断错误,也是一个很好的方法来检查映射。

The wizard uses a smaller value as the standard varchar size for Excel data than you got in the wizard in SQL Server 2000. As a result it often truncates data that you are trying to do a quick import to a staging table on. However, when you do the wizard, one screen will ask you if you want to edit mappings and you can fix the size of the fields there. Or you can usea create table stament first to create a work table with the sizes you want (nvarchar(max) is good if you are looking at the data for the first time and have no idea how big the fields will be) and then import into it. With Excel, I know I have also had issues with SQl Server using only a few rows to determine datatype and then the insert failing for records (say for something like partnumber) because it thought based on the first few records it was an integer when it was really a string type of data. You also could be having an issue like this, so it is a good idea to review the mappings anyway even if you don't get truncation errors.

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

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