0
votes

I see other post for same kind of error, but seems not solution working out. I am getting the same error "Operation on target Copy data into Target failed: ErrorCode=TypeConversionFailure,Exception occurred when converting value '2150002867256' for column name 'sourceKey' from type 'String' (precision:255, scale:255) to type 'Int32' (precision:, scale:). Additional info: Value was either too large or too small for an Int32."

My source (Synapse) column type (Varchar (249) and Target (Couchbase) column type are same STRING. But not sure the error for the value '2150002867256' . Its a ODBC connection between Synapse and Couchbase. And doing COPY Activity in ADF

Please help if anyone has any input. Thank you so much.

enter image description here

1
did you rest the schema when mapping the column? This operation will set all the columns as String data type and then convert them to the sink data type. Can you show us the screenshot of the mapping?Leon Yue
Hi @Vikas, you must change your sink table schema to other data type, like bigint. The error will be solved. If my answer is helpful for you, please accept it as answer. This can be beneficial to other community members. Thank you.Leon Yue
In NoSQL we cannot defiled the datatype. It defined the datatype internally while inserting data into bucket. As my source is Synapse and target is couchbase. I tried with cast(cast(sourcekey as BIGINT) as VARCHAR), in copy query but still not resolved. It may be a ODBC configuration issue also but not sure. very weirdVikas

1 Answers

0
votes

Your data type of sink table schema column sourceKey must be INT(Transact-SQL):

enter image description here

The value '2150002867256' is out of the int range that caused the error. You could test is in SSMS and you will get the error: enter image description here

You must change your sink table schema to other data type, for example bigint. It works well. enter image description here