RE: Err Msg: String data, right truncation

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



If I remember correclty some Chinese characters can be 4 bytes long.

Try increasing the varchar( size ) value until you don't get the truncation
error.

Don't forget you need to increase your string buffer size on your client as
you increase the varchar column size.

Are you inserting using SQLBindParameter? Is so, perhaps you're passing in
too small of a buffer size when you're describing your data's buffer size.

Hope this helps.



--------------------
| Thread-Topic: Err Msg: String data, right truncation
| thread-index: AcWzavXE58gFfovkS7mbF7dGV64u5A==
| X-WBNR-Posting-Host: 219.95.23.64
| From: =?Utf-8?B?WW9rZSBIZW5n?= <YokeHeng@xxxxxxxxxxxxxxxxxxxxxxxxx>
| Subject: Err Msg: String data, right truncation
| Date: Tue, 6 Sep 2005 22:14:02 -0700
| Lines: 12
| Message-ID: <2CA1D7E4-425B-4133-BF10-19587B573119@xxxxxxxxxxxxx>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.odbc
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.odbc:2675
| X-Tomcat-NG: microsoft.public.sqlserver.odbc
|
| Fieldname: Description - varchar(100)
| I tried to insert a record together with the above field - Description -
in
| Chinese characters. Once I enter the Chinese characters more than 50
| characters, the err msg promt out : "[ODBC SQL Server Driver]String data,
| right truncation".
| I have tried to change the length to varchar(200) or more and
nvarchar(200)
| or more, the same err msg prompt out.
| What should I do? If I want the field is able to store 100 chinese
characters.
|
| Thanks for help in advance!
|
| YH
|

.