What are alternates data type for "sql server - xml and image" data types in synapse lake db?

K Tharangini 0 Reputation points
2024-08-13T12:03:53.22+00:00

I am migrating data from sql server to lake database - delta tables, I am using string data type in delta table as an alternative for xml data type - sql table. I am getting below error. How this can be handled is there any other data type which can be used as an alternate for XML.Similarly, for image - sql data type I am using binary- lake db table and getting similar error.

Error Message: String or binary data would be truncated while reading column of type 'VARCHAR(8000)'

Any suggestions please?

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,373 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bhargava-MSFT 31,261 Reputation points Microsoft Employee Moderator
    2024-08-13T23:12:05.2433333+00:00

    Hello K Tharangini,

    Welcome to the Microsoft Q&A forum.

    In Serverless By default, the string type in delta table will be resolved to varchar(8000) by schema inference. This is documented here: https://learn.microsoft.com/en-us/azure/synapse-analytics/sql/best-practices-serverless-sql-pool#check-inferred-data-types

    To resolve this, please define schema using WITH clause and setting ‘VARCHAR(MAX)’ for the problematic column.


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.