"Conversion failed because the data value overflowed the specified type" error applies to only one column of the same table

35,272

Solution 1

It sounds to me like you have one or more bad dates in the column. With 4,000 rows, I actually would visually scan and look for something very short or very long.

You could change your source to selecting top 1 instead of all 4,000. Do those insert? If so, that would lend weight to the bad date scenario. If 1 row does not flow through, it is another issue.

Solution 2

(I will just share my experience, how I overcame this problem, in case it helps someone)

My scenario:

One of the column Identifier in the ole db data source has changed from int to bigint. I was getting the error message - Conversion failed because the data value overflowed the specified type.

Basically, it was telling me the source data size was greater than the destination data size.

What I have tried:

In the ole db data source and destination both places, I clicked "show advanced editior", checkd the data type Identifier was bigint. But still, I was getting the error message

The solution worked for me:

In the ole db data source--> show advanced edition option--> Input and Output Properties--> OLE DB Source Output--> there are two options - External columns & Output columns. enter image description here

In my case, though the Identifier column in the External columns was showing the data type bigint, but in the Output columns was showing the data type int. So, I changed the data type to bigint and it has solved my problem.

enter image description here

Now and then I get this problem, specially when I have a big table with lots of data.

I hope it helps.

Solution 3

We had this error when someone had entered the year as 216 instead of 2016. The data source was reading the data ok but it was failing on the OLEDB destination task. We use a script task in the data flow for validation. By adding a check that dates aren't too far in the past we are able to trap this kind of error and at least generate a meaningful error message to find and correct the problem quickly.

Share:
35,272
Vadzim Savenok
Author by

Vadzim Savenok

"There is no such thing as Impossible, but there is always a matter of Time to make it Possible!"

Updated on July 16, 2021

Comments

  • Vadzim Savenok
    Vadzim Savenok almost 3 years

    I am trying to import data from database access file into SQL server. To do that, I have created SSIS package through SQL Server Import/Export wizard. All tables have passed validation when I execute package through execute package utility with "validate without execution" option checked. However, during the execution I received the following chunk of errors (using a picture, since blockquote uses a lot of space):

    Errors

    Upon the investigation, I found exactly the table and the column, which was causing the problem. However, this is problem I have been trying to solve for a couple days now, and I'm running dry on possible options.

    Structure of the troubled table column

    As noted from the error list, the trouble occurs in RHF Repairs table on the Date Returned column. In Access, the column in question is Date/Time type. Inside the actual table, all inputs are in a form of 'mmddyy', which when clicked upon, turn into 'mm/dd/yyyy' format:

    Input for March 8, 2004

    In SSIS package, it created OLEDB Source/Destination relationship like following:

    Relationship in SSIS

    Inside this relationship, in both output columns and external columns data type is DT_DATE (I still think it is a key cause of my problems). What bugs me the most is that the adjacent to Date Returned column is exactly the same as what I described above, and none of the errors applied to it or any other columns of the same type, Date Returned is literally the only black sheep in the flock.

    What have I tried

    I have tried every option from the following thread, the error remains the same.

    I tried Data conversion option, trying to convert this column into datestamp or even unicode string. It didn't work.

    Data Conversion

    I tried to specify data type with the advanced source editor to both datestamp/unicode string. I tried specifying it only in output columns, tried in both external and output columns, same result.

    Plowing through the data in access table also did not give me anything. All of them use the same 6-char formatting through it all.

    At this point, I literally exhausted all options I could think of. Can you please point me in the right direction on what else I could possibly try to resolve it, since it drives me nuts for last two days.

    PS: On my end, I will plow through each row individually, while not trying to get discouraged by the fact that there are 4000+ row entries...

    UPDATE:

    I resolved this matter by plowing through data. There were 3 faulty entries among 4000+ rows... Since the issue was resolved in a manner unlikely to help others, please close that question.