Excel to SQL DB Table :Column Space truncated

Santhi Dhanuskodi 305 Reputation points
2024-07-19T06:56:57.6033333+00:00

Hi,

I am facing an issue while copying data from excel to Azure SQL DB, I am using a simple copy activity.

If I have a trailing space at the end of column value, that space is truncated.

for Eg, i have a colun 'client' , and one of the values is 'airtel '....., the last space after l is truncated, I can see only 'airtel' without space. why this is happening? how do I bring the data as is?

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

2 answers

Sort by: Most helpful
  1. Chandra Boorla 2,525 Reputation points Microsoft Vendor
    2024-07-19T12:26:25.3266667+00:00

    Hi @Santhi Dhanuskodi

    Thanks for the question and using MS Q&A platform.

    As I understand you are experiencing an issue with the Copy Activity in Azure Data Factory where trailing spaces are being truncated when copying data from Excel to Azure SQL DB.

    I tried to repro the scenario from my end, and I was able to preserve the trailing spaces before the single quote.PostgreSQL

    Could you please recheck and try with your data, and then rerun the copy activity with your Azure SQL DB?

    Please do let me know, if you have any further queries. Glad to help.


  2. Olaf Helper 44,941 Reputation points
    2024-07-22T07:42:18.2566667+00:00

    If the table column data type is "varchar", then it's by design that trailing spaces will be truncated.

    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.