Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Kohila
Contributor III
Contributor III

Table suspend with error [Microsoft][ODBC Driver 17 for SQL Server]String data, right truncation (22001 nativeerror)

Table suspend with error with the follwoing error in LR task, with target as SQL Managed instance.

could not see any issue /diiference in DDL on source and target. 

RetCode: SQL_SUCCESS SqlState: 22001 NativeError: 0 Message: [Microsoft][ODBC Driver 17 for SQL Server]String data, right truncation

 

Could you help to understand what causing the issue. On verbose could not fetch the exact column undergoing the truncation.

1 Reply
SachinB
Support
Support

Hello @Kohila ,

This error message typically indicates that you are trying to insert or update data into a SQL Server table and the data you are trying to insert or update exceeds the maximum length of the column in the table.

  1. Check the data types and lengths of the columns in the table you are trying to insert or update. Make sure that the data you are trying to insert or update matches the data type and length of the column. For example, if the column is of type varchar(10), make sure that the data you are trying to insert or update is 10 characters or less.

  2. Check the length of the data you are trying to insert or update. If the data is longer than the maximum length of the column, you will need to truncate the data before inserting or updating it. You can use functions like LEFT or SUBSTRING in your SQL statement to truncate the data.

  3. Check the version of your ODBC driver. If it is an older version, try upgrading to the latest version to see if the issue is resolved.
  4. Verify do you have any special character in the incoming string

    If not resolve, kindly raise the support case along with enhanced logs, we will take care of it 

    Regards,
    Sachin B