PC Review


Reply
Thread Tools Rate Thread

The data is truncated

 
 
Keld Laursen
Guest
Posts: n/a
 
      24th Nov 2004
Might this be because the "nvarchar(40)" declaration declares a varchar(40)
array that can hold 40 8-bit characters, as opposed to 40 16-bit characters
(Unicode)?

IIRC, this is one of the differences between the varchar() and nvarchar()
data types.

HTH

Keld Laursen

"oren" <(E-Mail Removed)> wrote in message
news:uEiw3$(E-Mail Removed)...
> Hello,
>
> I have a table with a field defined as nvarchar(40).
>
> When I am trying to post a value longer than 20 characters, SQLCE returns
> the abouv error.
>
> When I am using the sample string "12345678901234567890" and it works OK
> (Len=20)
> When I am using the sample string "123456789012345678901" and it works

Fails
> (Len=21)
>
> I also tried dynamic SQL query and paramaterized query (also trying to
> manually set SqlCeParameter.size=40)).
> Both gave me the same result.
>
> Any idea ?
>
>
>



 
Reply With Quote
 
 
 
 
oren
Guest
Posts: n/a
 
      24th Nov 2004
Hello,

I have a table with a field defined as nvarchar(40).

When I am trying to post a value longer than 20 characters, SQLCE returns
the abouv error.

When I am using the sample string "12345678901234567890" and it works OK
(Len=20)
When I am using the sample string "123456789012345678901" and it works Fails
(Len=21)

I also tried dynamic SQL query and paramaterized query (also trying to
manually set SqlCeParameter.size=40)).
Both gave me the same result.

Any idea ?



 
Reply With Quote
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      24th Nov 2004
Are you specifying the parameter type to be SqlDbType.NVarChar? The peculiar
difference between your two strings is that the first one is an integer that
fits a 64-bit representation, while the second one does not (it exceeds
2^64-1). It looks almost like your strings are getting converted to bigint
somewhere. Also, what exactly is "above error"? I don;t think you included
the error message in your post

--
Alex Feinman
---
Visit http://www.opennetcf.org
"oren" <(E-Mail Removed)> wrote in message
news:uEiw3$(E-Mail Removed)...
> Hello,
>
> I have a table with a field defined as nvarchar(40).
>
> When I am trying to post a value longer than 20 characters, SQLCE returns
> the abouv error.
>
> When I am using the sample string "12345678901234567890" and it works OK
> (Len=20)
> When I am using the sample string "123456789012345678901" and it works
> Fails
> (Len=21)
>
> I also tried dynamic SQL query and paramaterized query (also trying to
> manually set SqlCeParameter.size=40)).
> Both gave me the same result.
>
> Any idea ?
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
data gets truncated SAm Microsoft Access Queries 2 5th Sep 2008 05:59 PM
Linking two spreadsheet, pulling data from one cell to another, data is being truncated Ben Microsoft Excel Worksheet Functions 0 13th Sep 2007 11:41 PM
truncated data =?Utf-8?B?YW1pcmFtb20=?= Microsoft Excel Misc 3 10th Apr 2007 05:44 PM
Truncated data =?Utf-8?B?RGFuIEBCQ0JT?= Microsoft Excel Misc 3 27th Oct 2006 09:55 PM
Data being truncated FA Microsoft Access Forms 4 8th Mar 2006 05:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:28 AM.