Hi, iam facing the error microsoft odbc driver 17 for sql server string data right truncation when trying to perform insert query in column which is varbinary(max)

Harinkhede, Bhavna 0 Reputation points

development work in C++ builder 2007

and using SSMS 19 SQL server 2022


my connectionstring

ConnectionString=Provider="MSDASQL.1";Persist Security Info="False";Data Source="ODBC17Setup";Initial Catalog="DB"

IN DB the column in which i am performing insert operation is Varbinary(max)

in c++ builder 2007 we are managing this data using Blob and also there is no issue if provider is SQLNCLI11 and in DataSource we are passing sql server name only issue is when connecting is using above mentioned connection string

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
11,602 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Harinkhede, Bhavna 0 Reputation points

    also i was going through this link https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/known-issues-in-this-version-of-the-driver?view=sql-server-ver16#next-steps

    f the client encoding is UTF-8, the driver manager doesn't always correctly convert from UTF-8 to UTF-16. Currently, data corruption occurs when one or more characters in the string aren't valid UTF-8 characters. ASCII characters are mapped correctly. The driver manager attempts this conversion when calling the SQLCHAR versions of the ODBC API (for example, SQLDriverConnectA). The driver manager won't attempt this conversion when calling the SQLWCHAR versions of the ODBC API (for example, SQLDriverConnectW).

    0 comments No comments