Error while using sqlwrite - String data, right truncation

Hello, I am using the database toolbox, and I want to add a database to an already existing database on Microsoft SQL server.
However, I get this error:
Error using database.odbc.connection/sqlwrite (line 214)
ODBC JDBC/ODBC Error: ODBC Driver Error: [Microsoft][SQL Server Native Client 11.0]String data, right truncation.
Error in write2db (line 15)
sqlwrite(Conn, TableName, Table)
FYI, the number of columns are the same. I don't know if it is due to heavy strings or not.
Does someone have an idead?
Thanks a lot

댓글 수: 5

I wonder if one of the fields you are trying to write is a string object or character vector (or, more likely, cell array of character vectors), and if the field was defined as a fixed width, and you are trying to write something wider than was allocated?
Thank you. Well my objects are tables, and each day I am supposed to add a table in my database on SQL. Do you think it is a class issue?
All of these tables have the same width.
What is the actual query that causes this error?
Also, see this article from Microsoft. Updating SQL server may fix the problem.
Thank you for your answers. The problem wat that there was a longer string than the maximum length defined for a specific column.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Reporting and Database Access에 대해 자세히 알아보기

제품

릴리스

R2018b

질문:

2019년 4월 2일

댓글:

2019년 4월 3일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by