Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Stored Procedure Help...again

Author  Topic 

jrockfl
Posting Yak Master

223 Posts

Posted - 2005-02-07 : 17:18:44
The stored procedure is rounding the price from 8.99 to 9

The column price is decimal (precision 18 scale 2)
If I type in 8.99 directly in EM it accepts it correctly and doesnt round. Here is my SPROC

CREATE Procedure UpdatePrice
(
@finalprice decimal,
@regid varchar (50),
@webcategoryid varchar (50)
)

AS
UPDATE tblCart
SET price = @finalprice
WHERE regid = @regid
AND webcategoryid = @webcategoryid

nr
SQLTeam MVY

12543 Posts

Posted - 2005-02-07 : 17:25:14
@finalprice decimal(18,2)

the default precision for deciml is 0 dec places - and confuses matters.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

jrockfl
Posting Yak Master

223 Posts

Posted - 2005-02-07 : 18:48:37
Perfect! Thank you
Go to Top of Page

jrockfl
Posting Yak Master

223 Posts

Posted - 2005-02-07 : 21:51:47
I just tried your suggestion and it didnt work for me. I tried money too. What else can i do?

(
@finalprice money,
@regid varchar (50),
@webcategoryid varchar (50)
)
Go to Top of Page

jrockfl
Posting Yak Master

223 Posts

Posted - 2005-02-07 : 23:21:07
I got it working now, thank you :)
Go to Top of Page
   

- Advertisement -