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.
| Author |
Topic |
|
ProEdge
Yak Posting Veteran
64 Posts |
Posted - 2007-07-18 : 12:03:21
|
Hi everyone, I'm running into an issue here I can't figure out. I am moving some data from one table to another. In table A, I have a column of data type numeric(22,6). I'm moving these values to table B, with a column of data type decimal(11,6). According to BOL, I need to explicitly cast it which I figured, so I casted it this way:SELECT ( CAST(myColumn as decimal(11, 6)) ) For whatever reason, I still get an arithmetic overflow error. The error reads "Arithmetic overflow error converting numeric to data type numeric." I've also tried Convert with no success. I'm a little confused because I thought by explicitly casting it, the numbers that are too large for the column would automatically be truncated. Am I wrong on this? Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-07-18 : 12:04:54
|
| It does not truncate the data. You either need to expand the column in tableB to the maximum length of the data or truncate it on your own.Tara Kizerhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
ProEdge
Yak Posting Veteran
64 Posts |
Posted - 2007-07-18 : 12:08:38
|
| I see then. Thanks |
 |
|
|
|
|
|