Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Decimal problem

Status
Not open for further replies.

royyan

Programmer
Jul 18, 2001
148
US
I am trying to input decimals to the SQL database. I call Stored procedure to pass the data to the SQL server. The field acceptting this data is set as 'decimal' type with precision=10 and scale=2.
However, my input turn out as integer in the database, for example 4.5 become 5 in the database.
Please help me point out what's wrong with my database settings.
Thanks a lot!

 
Is the parameter accepting the input on your stored proc declared as a decimal data type as well? E.g.

[tt]@testDecimal decimal(10,2)[/tt]

I don't think it's the database settings, since you've stated that the field is typed correctly. I would think the data's not being passed correctly from your stored proc, either as mentioned above or some other way. Perhaps you could post the relevent stored proc code so we could take a look at it, if the above solution doesn't work.

HTH,
jp
 
jp, I found my probelm. It's in Stored Procedure. I forgot to include (10, 2) after decalre decimal datatype. Thanks a lot!
 
No problem. I do that all the time with the decimal type - it's easy to overlook.

jp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top