Why ADF is able to handle decimal value while using copy activity?

Sharma, Ankush Kumar 0 Reputation points
2024-01-28T16:33:57.2733333+00:00

ADF is throwing below error when we are trying to copy data from salesforce to onprem SQL server. we are using auto create table option. But the source has correct decimal value, which seems to be easily read and write. Could you please help us how to handle this? Error: "ErrorCode=SqlOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=A database operation failed. Please search error to get more details.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.InvalidOperationException,Message=The given value of type Decimal from the data source cannot be converted to type decimal of the specified target column.,Source=System.Data,''Type=System.InvalidOperationException,Message=The given value of type Decimal from the data source cannot be converted to type decimal of the specified target column.,Source=System.Data,''Type=System.ArgumentException,Message=Parameter value '-900.0000000000000000' is out of range.,Source=, User's image

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,625 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Harishga 6,000 Reputation points Microsoft External Staff
    2024-01-29T10:50:26.66+00:00

    Hi @Sharma, Ankush Kumar
    Welcome to Microsoft Q&A platform and thanks for posting your question here.

    Azure Data Factory is able to handle decimal values while using copy activity because it supports data type mapping between the source and sink columns.

    The error message indicates that the given value of type Decimal from the data source cannot be converted to type decimal of the specified target column. The error message also indicates that the parameter value '-900.0000000000000000' is out of range. This error occurs when the decimal value in the source data is not compatible with the decimal data type in the target column.

    To resolve this issue:

    Need to ensure that the data type, precision, and scale of the source column and the target column are compatible with each other. If they are not compatible, you can modify the target column to match the precision and scale of the source column or use a data conversion activity to convert the data type of the source column to match the data type of the target column.

    Reference:

    https://learn.microsoft.com/en-us/azure/data-factory/copy-activity-schema-and-type-mapping#data-type-mapping

    I hope this information helps you. Let me know if you have any further questions or concerns.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.