由于可能会丢失数据

由于可能会丢失数据

本文介绍了SSIS-由于可能会丢失数据,因此无法转换该值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对SSIS比较陌生.我正在尝试使用Microsoft OLEDB for Oracle从Oracle数据库中提取信息,并且正在使用以下查询:

I am relatively new to SSIS. I am trying to extract information from an Oracle database using Microsoft OLEDB for Oracle and I am using this query:

SELECT ID FROM Test

我收到一条错误消息:the value cannot be converted because of a potential loss of data.如果我将查询更改为以下内容,那么它将起作用:

I get an error message saying: the value cannot be converted because of a potential loss of data. If I change the query to the following then it works:

SELECT '1' FROM Test

我认为它失败了,因为ID不是整数.但是,平面文件连接管理器显示OutputColumnWidth为50.我在做什么错了?

I think it is failing because the ID is not an integer. However, the flat file connection manager shows that the OutputColumnWidth is 50. What am I doing wrong?

更新格林尼治标准时间16:30
我对此进行了更多研究,似乎是造成频率"或无"直方图的列导致了问题.直方图为高度平衡"的人似乎还可以.

Update 16:30 GMT
I have looked into this a little more and it appears to be the columns that have a Histogram of 'frequency' or 'none' that are causing the problems. Those with a Histogram of 'Height Balanced' appear to be OK.

推荐答案

这是常见的事情.在很多情况下,从无法确定列元数据的另一种类型的系统导入ssis的默认值是默认值str(50).由于您试图将其推入一个字符列,因此它假定您可能会丢失数据.只需右键单击并选择显示高级编辑器..."即可进入源组件

This is a common thing. The default in a lot of cases for imports into ssis from another type of system where metadata for columns cannot be determined is to default to str(50). Since you are trying to push that into a one character column, it assumes that you may lose data. Simply go into the source component by right clicking and choosing "Show Advanced editor..."

然后导航到最后一个标签(输入和输出属性)

Then navigate to the last tab (Input and Output Properties)

点击OLE DB源输出旁边的+

Click the + next to OLE DB Source Output

点击输出列旁边的+

突出显示"ID"列

滚动到对话框右侧的长度数据类型"属性,然后将其从50更改为1.

Scroll to the Length Data Type Property on the right of the dialog box and change it from 50 to 1.

这篇关于SSIS-由于可能会丢失数据,因此无法转换该值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 00:04