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
 General SQL Server Forums
 New to SQL Server Programming
 Problems storing a decimal again.......

Author  Topic 

Pinto
Aged Yak Warrior

590 Posts

Posted - 2007-03-14 : 11:48:18
I had an earlier problem updating a field in a sql table witha decimal which was sorted. I am now having the problem again.

In the SQL table my field is type numeric and scale 2
In my asp.net code I have stepped through the running code and the value is 77.50
However when the sp updates the table it is stored as 78.

In the sp the parameter is type numeric.

TIA for any help

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-03-14 : 11:51:31
What is the ASP.NET parameter datatype?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-03-14 : 11:52:21
Have you defined matching scale for parameter as well?

Something like this:

Create Proc something
(
@param1 numeric(20,2)
...


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Pinto
Aged Yak Warrior

590 Posts

Posted - 2007-03-14 : 11:55:33
@param1 numeric(20,2)

Has worked.

Thank you once again Harsh Athalye for helping me.

I have so much to learn - and remember
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-03-14 : 12:00:55
Glad it helped.

Please note, however, numeric(20,2) is just an example. You will have to adjust precision and scale as per your needs.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -