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
 Transact-SQL (2000)
 Over flow issue

Author  Topic 

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2004-08-30 : 19:18:51
I have 3 main fields for which an insert is needed..

property_value,decimal(3,2),>, <value_loss,decimal(3,2),>, <value_repaired,money,>

This is the data type used.No When I try to insert a 30 or 30.00 or 30.0 it gives an error:-

Arithmetic overflow error converting numeric to data type numeric.Should i convert it to some other format

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-08-30 : 19:25:16
Use decimal(4, 2).

30, 30.00 and 30.0 all are 30.00 when using decimal and scale of 2, so you need precision of 4.

Tara
Go to Top of Page

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2004-08-30 : 19:28:36
The table is already being designed by other section and now they are keeping it as such.insertion is becoming a pain.Is there any way to come around it..
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-08-30 : 19:34:56
You need to fix the table using ALTER TABLE ALTER COLUMN. If they don't want to fix it, then they can only have numbers between -9 and 9 inserted into it.

Tara
Go to Top of Page

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2004-08-30 : 19:45:17
Yes it works if I alter the column or if its a precision of 3.I was testing with some dummy data and now when i cross checked with the production data its okay..it always maintains the precision of 3
Go to Top of Page

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2004-08-30 : 19:55:48
Thanks tara for the quick response
Go to Top of Page
   

- Advertisement -