Column truncate issue - Copy file to DB ADF pipeline

ADF_Coder 0 Reputation points
2024-07-19T17:52:29.9766667+00:00

Hi All,

I have a pipeline where I am copying data from a file to a database. In the file, I have a few columns with extra spaces that I need to trim or truncate. I am not getting any option to use any transformation or function (dynamic content) on the destination side.

I have to do this in the ADF copy activity only.

 

Please help and suggest.

User's image

Azure SQL Database
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,135 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Amira Bedhiafi 19,706 Reputation points
    2024-07-19T19:06:10.1566667+00:00

    Instead of directly using a Copy activity, where you add a Derived Column transformation to trim the extra spaces from the columns. For each column that needs trimming, add a new derived column with the following expression:

    
    trim(columnName)
    
    

    For example, if you have a column named CustomerName, you would use:

    
    trim(CustomerName)
    
    

    Add a Sink transformation and configure it to write to your Azure SQL Database.


  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more