Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

How to update text field varchar length at synapse SQL database

How do I update text field varchar length at synapse SQL database, from 120 to 500?

Or can I not set a length limit at all?

 

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    If you are using PolyBase external tables to load your Synapse SQL tables, the defined length of the table row cannot exceed 1 MB. When a row with variable-length data exceeds 1 MB, you can load the row with BCP, but not with PolyBase.

     

    • Avoid defining character columns with a large default length. For example, if the longest value is 25 characters, then define your column as VARCHAR(25).
    • Avoid using [NVARCHAR][NVARCHAR] when you only need VARCHAR.
    • When possible, use NVARCHAR(4000) or VARCHAR(8000) instead of NVARCHAR(MAX) or VARCHAR(MAX).
    • Avoid using floats and decimals with 0 (zero) scale. These should be TINYINT, SMALLINT, INT or BIGINT.

    More details : Table data types in Synapse SQL - Azure Synapse Analytics | Microsoft Docs

     

    If I have misunderstood you meaning, please provide more details.

     

     

    Best Regards

    Community Support Team _ Polly

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.