Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error: Data would be truncated
Message
From
30/06/2006 16:54:01
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
30/06/2006 08:39:20
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01133038
Message ID:
01133204
Views:
16
>Getting the message 'String or binary data would be truncated.' when I try to save an updated remote view back to SQL Server.
>
>Only one field in the view is set to Updateable and that field is defined as decimal (15,2) in SQL Server. The view, as initially set in ViewEditor, had the field defined as N(17,2). I changed it to N(15,2) and still got the error. I also tried N(10,2) and, after Del Lee pointed out that SQL Server doesn't count the decimal in the length of the field, N(16,2). In all cases I get the same error and the table isn't updated.
>
>Can anyone suggest what else I should be checking?

Could it be that Fox crammed a larger value, by removing decimals? It's a known artefact of xBase that it will just push the decimals out to accomodate a larger value... for instance, if you have a N(5,2) and try to store a 2999.50 into it, it will be stored as "2999.5" regardless of its two-decimal (though in my case, when I tried it in VFP9,
CREATE CURSOR nn (n n(5,2))
APPEND BLANK
REPLACE n WITH 2999.5
?n
returned 3000 (so it did some rounding up). Just try inserting values like 99.55, -99.52 etc to see how Fox behaves here.

So, check not just the width of your view's field, but the actual number that's in it.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform