Arithmetic Overflow Error Numeric to Varchar

  • HELP!

    I have a DTS package that's been running for 4 years pulling data out of our ERP system running on an iSeries DB2 database and putting the data into an SQL 2005 database.

    The table being download is critically important to our production activities (order header).

    The problem field is the customer number. It's datatype in db2 = decimal(10, 0) and the datatype in SQL = decimal(10, 0).

    Yesterday the DTS download began to fail (as well as several other stored procedures which use the SQL table) with an Arithmetic Overflow Error Numeric to Varchar

    because the customer numbers finally roled over from 9999 to 10000. The 10000 is causing the error. But why?

    If I run this query: "Select * from SQLSupport.dbo.ORHED Where OHCSNO <> 10000"; all of the records with custno <> 10000 are returned.

    If I run this query: "Select * from SQLSupport.dbo.ORHED Where OHCSNO" or this one "Select * from SQLSupport.dbo.ORHED Where OHCSNO = 10000"; I get the error.

    Currently I've had to put "<> 10000" in every query/procedure that is failing.

    Can anyone help me?

  • Resolved.

    The problem wasn't with the customer number field itself, but rather with a computed field in the same table that used the customer number field. It was casting it to a varchar(4).

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply