Pasupathy Devraj
Pasupathy Devraj

Reputation: 11

ADF copy activity is failing while converting from string to Decimal

I have a copy activity in Azure Data Factory that takes CSV file as source and SQL table as destination.

Source data type is 'string' and destination is 'Decimal'

Let's take an example of source value ,

100612324864664000.00

This is the error message I am getting ,

Message=Column 'xyz' contains an invalid value '1.0061232486466467E+17'.,Source=Microsoft.DataTransfer.ServiceLibrary,''Type=System.ArgumentException,Message=Input string was not in a correct format.Couldn't store <1.0061232486466467E+17> in xyz Column. Expected type is Decimal.

Upvotes: 1

Views: 5903

Answers (2)

Andrew Yanchak
Andrew Yanchak

Reputation: 45

Have the same problem. You need to use 'format' in your "toDecimal" method. eg:

toDecimal("123.45",10,4,'#.##')

Upvotes: 1

Jay Gong
Jay Gong

Reputation: 23782

I tested your description and it works for me.

Source dataset:

enter image description here

Sink dataset:

enter image description here

Pipeline mapping:

enter image description here

Result:

enter image description here

Upvotes: 1

Related Questions