Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Numeric fields in SQL vs VFP
Message
 
 
To
01/04/2010 22:46:59
General information
Forum:
Microsoft SQL Server
Category:
Database design
Environment versions
SQL Server:
SQL Server 2005
Application:
Desktop
Miscellaneous
Thread ID:
01458467
Message ID:
01458469
Views:
60
>Hi All,
>I am converting an application from VFP as data and VFP as UI to SQL/VFP as a database and VFP as a front end.
>I did not notice it right away, but numeric type in SQL server is slightly different then in VFP.
>In SQL server, if I setup type of a field to be numeric(10,2), it means that it will allow 10 digits total, 2 of which will be after decimal point.
>I do not have to provide an additional digit for the "-" sign or for the decimal point. In VFP - 10 characters total, 2 digits after decimal point, but it will include decimal point and a "-" sign if negative number is used as part of the 10 characters.
>
>I also have noticed that if I use SPT or even a stored procedure to bring the data from the server, the numeric field type will change. So my numeric(10,2) field will become numeric(12,2). Which is great, but .... my users now can enter a bigger number then the data structure allowed. When saving the entered data to the server they will receive an error. Most of my numeric fields on the form depend on the control source, to control the size of the data entered into it. There would be too many objects on the screen to enter an input mask individually. Did anyone has this issue? Any suggestions?
>
>Thank you
>Yelena

I know that this problem was discussed before Re: Getting a Numeric value out of range when using view Thread #1304392 Message #1304418 or Strange numeric field values Thread #1109091 however, I'm not sure that any common solution exists.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform