How to put first 4000 symbols from string to field?

Sergey Ufimtsev 1 Reputation point
2021-02-26T08:33:40.117+00:00

Hello! I have a table in azure sql with field type nvarchar(4000) and i am getting data from api with copy command and some times data from api has more than 4000 symbols and i want to store first 4000 symbols or default value "data too long".

How can i achieve this?

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

1 answer

Sort by: Most helpful
  1. HimanshuSinha-msft 19,381 Reputation points Microsoft Employee
    2021-02-26T23:40:32.64+00:00

    Hello @Sergey Ufimtsev ,
    Thanks for the ask and using the Microsoft Q&A platform .
    Have you tried the option of "allow data truncation " under mapping ? I am adding snaphot below .

    72603-2021-02-26-15-37-37-analytics-moveandtransform-ver.png

    Please do let me know how it goes .
    Thanks
    Himanshu
    Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members