all groups > sql server data mining > december 2003 >
You're in the

sql server data mining

group:

Arithmetic overflow error converting numeric to data type numeric.


Arithmetic overflow error converting numeric to data type numeric. Richard Morey
12/11/2003 10:31:18 AM
sql server data mining:
Hi,

I am trying to move data from an old Access db into SQL 2000.

I have imported the old Access db into SQL and now I am running queries to
move the data from the old tables to the new tables. If I run this
statement:

SELECT CONVERT(NUMERIC,LEFT(GARAGE,3)) AS GARAGECARS FROM OLD_HOUSMAIN


I get all 8025 records and no errors.

If I try to run this statement:

INSERT INTO TABLEHOUSES (GARAGECARS)

SELECT CONVERT(NUMERIC,LEFT(GARAGE,3)) AS GARAGECARS FROM OLD_HOUSMAIN

I get this error:

Arithmetic overflow error converting numeric to data type numeric.

Any ideas why? It seems to me that since the SELECT statement executes on
its own, the insert should as well. I've check and there are no null or
empty strings in the old db..

Thanks

Rich

Arithmetic overflow error converting numeric to data type numeric. Derek Shi
12/11/2003 11:14:19 PM
It seems to me that the attribute in the table
Tablehouses is not accepting numeric data type. Try
changing the data type of the attribute.

Derek

[quoted text, click to view]
Re: Arithmetic overflow error converting numeric to data type numeric. Richard Morey
12/12/2003 3:20:39 PM
But the data type in question is numeric..

Rich

[quoted text, click to view]

Re: Arithmetic overflow error converting numeric to data type numeric. Ken H
1/9/2004 9:48:24 AM
The precision of field "GARAGECARS" is probably less than
necessary to accomodate all values from the conversion in
your select statement. Find the precision and scale of
field "GARAGECARS" and try the select statement again
specifying precision & scale, for example ...

"GARAGECARS" is a NUMERIC(3,1)

Change your query to:

SELECT CONVERT(NUMERIC(3,1),LEFT(GARAGE,3)) AS GARAGECARS
FROM OLD_HOUSMAIN

If that fails then you need to increase the precision
and/or scale of the field.


[quoted text, click to view]
AddThis Social Bookmark Button