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.
10,521 questions
{count} votes

1 answer

Sort by: Most helpful
  1. HimanshuSinha-msft 19,471 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


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.