>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?
>
>TIA
Jim,
VFP map MSSQL decimal(X,Y) to N(X+2,Y),
but map N(Z,W) to MSSQL Float ( Double ) or CHAR() ( I don't remember exactly );
this conversion change the value to
SELECT CAST(10.47 AS FLOAT)
-- 10.470000000000001
When MSSQL convert 10.470000000000001 to D(15,2) the last digit "1" must to be truncated.
Verify this with SQL Profile.
This is a VFP's bad design for me.
A bad workaround is
SET NUMERIC_ROUNDABORT OFF
Fabio