数据类型错误(nvarchar而不是ntext) [英] Error in datatype (nvarchar instead of ntext)

查看:89
本文介绍了数据类型错误(nvarchar而不是ntext)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SSIS将数据从excel(.xls)导入到SQL Server 2008.我已经在Excel连接管理器的连接字符串中包含IMEX = 1.但是一列包含以下值:

I am importing data from excel(.xls) to SQL Server 2008 using SSIS. I have included IMEX=1 in the connection string of excel connection manager. But a column consists of a value as below:

4-Hour Engineer Dispatch ASPP Engr Dispatch 1: Up to 1 dispatch (8 hours) per year.  Hours exceeding allocation billed @ 1.5x hourly rate w/ 8-hr min Engr Dispatch:  8-hrs to arrive on-site from Ciena''s determination of need  On-Site Engineer Dispatch - 8 Hour ASPP Engr Dispatch 8: Up to 8 dispatch (64 hours) per year.  Hours exceeding allocation billed @ 1.5x hourly rate w/ 8-hr min Engr Dispatch:  NBD to dispatch from Ciena''s determination of need Per Incident On Site Support ASPP Engr Dispatch 12: Up to 12 dispatch (96 hours) per year.  Hours exceeding allocation billed @ 1.5x hourly rate w/ 8-hr min Engr Dispatch:  Next day to arrive on-site from Ciena''s determination of need  Resident Engineer Engr Dispatch:  2-hrs to arrive on-site from Ciena''s determination of need Engr Dispatch:  4-hrs to arrive on-site from Ciena''s determination of need ASPP Engr Dispatch 2: Up to 2 dispatch (16 hours) per year.  Hours exceeding allocation billed @ 1.5x hourly rate w/ 8-hr min N


实际上,该Excel文件中大约有600行.但是上述值仅在450行之后出现.因此,该列的数据类型默认为nvarchar(255)而不是ntext,因此出现错误.

任何人都请帮忙...预先感谢...


Actually there are about 600 rows in that Excel file. But the above mentioned value is present after 450 rows only. So, the datatype of that column is taken as nvarchar(255) as default instead of ntext and so I am getting error.

Anybody please help out... Thanks in advance...

推荐答案

您在Stack Overflow帖子中收到的答案(^ ])关于SSIS仅对数据的前8行进行采样是正确的.您需要听从发布者的建议,或者增加样本量,或者将其中一组具有较长数据的记录提升到顶部.
The answer you received in your Stack Overflow post (http://stackoverflow.com/questions/13452326/error-in-datatype-nvarchar-instead-of-ntext[^]) about SSIS sampling only the first 8 rows of the data is correct. You will need to take the advice of the poster and either increase the sample size or promote one of your records that has the longer set of data to the top.


这篇关于数据类型错误(nvarchar而不是ntext)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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