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
 smallmoney to money conversion problems

Author  Topic 

gnobber
Starting Member

11 Posts

Posted - 2008-08-28 : 21:40:45
Hi everyone,

I have created a system where you can purchase items and the system tracks it. Everything was going fine until I encountered an arithmetic overflow problem. Seems like I haven't anticipated that items can have values larger than the maximum amount of smallmoney. So I go into Management Studio, change the data type to money then save. I go back to the purchasing system but when I try to transact, I get this error:

"There is insufficient result space to convert a money value to smallmoney."

I've also tried directly editing existing rows in Management Studio. If it is larger than smallmoney, SQL Server Management Studio also throws this error. What could be the problem? Is there something I should do after converting from-to data types? Please help!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-29 : 01:55:59
does your table have lots of large varchar fieldS?
Go to Top of Page

dexter.knudson
Constraint Violating Yak Guru

260 Posts

Posted - 2008-08-29 : 06:15:14
Try running this in your database & it will show any tables where you may have missed changing values:
select *
from INFORMATION_SCHEMA.COLUMNS
where DATA_TYPE = 'smallmoney'
Go to Top of Page

dexter.knudson
Constraint Violating Yak Guru

260 Posts

Posted - 2008-08-29 : 06:16:37
Can you also do a text search thru your sql scripts to make sure you are not using any @variables & #OtherTables etc with this type?
Go to Top of Page
   

- Advertisement -