Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Datatype Conversion

Author  Topic 

ahsan19
Starting Member

7 Posts

Posted - 2006-11-17 : 14:33:25
I have a flat file source and am trying to convert a column type from string [DT_STR] to four-byte signed integer [DT_I4] before loading it into the destination. I am getting the following error message:

Error: 0xC02020A1 at Data Flow Task, Flat File Source [1]: Data conversion failed. The data conversion for column "contactID" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".

Here are the sample values for the column contactID:

113
114
115
116

At the destination, this column is defined as ContactID(int, not null). But the numbers are coming from flat file as [DT_STR] and I would like to convert those to four-byte signed integer [DT_I4] before finally loading them into the destination.

I have already tried Data Transformation Task and Derived Column Task without success.

How can I acheive this?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-17 : 23:59:52
The most obvious reason is that some of the rows in the columns is greater then the maximum capacity for signed INT, which is "2147483647".
Another reason can be that some rows in the the column is either empty space or null.
A third reason can be that your numbers are stored as unicode in the file and you have 6 digits or more for some rows.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -