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 |
|
hasanali00
Posting Yak Master
207 Posts |
Posted - 2006-04-07 : 05:40:50
|
| HiI have one table that has Varchar column, with values like: 0.234 or 8.8 or 0.938773I would like to insert these values into another table that has a Decimal (18,3) column. I am using following sql:UPDATE productsSET actualWeight = Cast (weight_kg as decimal(18,3)), VolumetricWeight = Cast ( volumetric as decimal(18,3))FROM stock_weights swWHERE products.productid = sw.stock_refI keep getting error message: "Error converting data type varchar to numeric. "Any idea how I can get SQL command to run?Thanks |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-04-07 : 05:44:35
|
you probablly have data in column weight_kg or volumetric that is not able to convert to decimaltry this to list out the problem dataselect *from stock_weightswhere isnumeric(weight_kg) = 0or isnumeric(volumetric) = 0 KH |
 |
|
|
hasanali00
Posting Yak Master
207 Posts |
Posted - 2006-04-07 : 05:57:35
|
| Thanks alotthat was the problem |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-07 : 09:10:31
|
| IsNumeric is not reliable. If you have data like 12,345.45, you have problem with thatRead thishttp://aspfaq.com/show.asp?id=2390MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|