Unix Technical Forum

Err Msg: String data, right truncation

This is a discussion on Err Msg: String data, right truncation within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Fieldname: Description - varchar(100) I tried to insert a record together with the above field - Description - in ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 09:53 PM
=?Utf-8?B?WW9rZSBIZW5n?=
 
Posts: n/a
Default Err Msg: String data, right truncation

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 09:56 PM
Warren Read
 
Posts: n/a
Default RE: Err Msg: String data, right truncation

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@discussions.microsoft.com>
| 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@microsoft.com>
| 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
|

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:24 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com