Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSIS - the value cannot be converted because of a potential loss of data

Tags:

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 

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 

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?

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.

like image 843
w0051977 Avatar asked Jul 31 '12 14:07

w0051977


People also ask

How do you fix the value could not be converted because of a potential loss of data?

In Excel Copy the column data and paste in different file. Delete that column and insert new column as Text datatype and paste that copied data in new column. Now in ssis package delete and recreate the Excel source and destination table change the column data type as varchar. This will work.

What is data conversion transformation in SSIS?

The Data Conversion transformation converts the data in an input column to a different data type and then copies it to a new output column. For example, a package can extract data from multiple sources, and then use this transformation to convert columns to the data type required by the destination data store.

What is error output in SSIS?

SSIS error outputs are a secondary path through which the data flow can send rows that do not conform to data type, length, or transformation standards defined by the ETL developer.


1 Answers

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)

Click the + next to OLE DB Source Output

Click the + next to Output Columns

Highlight the ID column

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

like image 97
William Salzman Avatar answered Oct 23 '22 06:10

William Salzman