Groups | Blog | Home
all groups > sql server new users > august 2006 >

sql server new users : Problem with REAL and Floats as parameter in Stored Procedure


complusman NO[at]SPAM yahoo.com
8/20/2006 8:07:29 PM
I have a stored procedure that has two parameters that have data types
of REAL. When the value is passed in, the values beyond the decimal
place is dropped and the the value prior to the decimal place is being
rounded up. I need it to keep the original value as passed in. If I
changed the parameter data type to varchar, it works. I'm using SQL
Server 2005.
Kent Tegels
8/21/2006 3:28:29 AM
Hello complusman@yahoo.com,

[quoted text, click to view]

Did you set the scale and precision on the parameters?

---
Thanks,
Kent Tegels, DevelopMentor
http://staff.develop.com/ktegels

Mike C#
8/24/2006 11:09:13 AM
REALs and FLOATs are approximations anyway. Try using the exact NUMERIC
types as parameters: @param1 NUMERIC(19, 10), @param2 NUMERIC(19, 10) and
see if it gives the results you're looking for.

[quoted text, click to view]

AddThis Social Bookmark Button