SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

An error occurred while executing batch. Error message is: Arithmetic Overflow

Recently an incident came across my desk where an end user was receiving an error trying to retrieve some records from the database.┬áThe error message the customer received was “An error occurred while executing batch. Error message is: Arithmetic Overflow”.

Experience has taught me that this message is related to an invalid dataset within a record or invalid column size. In this particular event the column was FLOAT and a data entry contain characters and symbols. Obviously an error in user entry or an import.

The issue that comes up is how can you query the data if it continues to give this error each time you try to query a set of data that contains that record. The easiest way is to convert the column to another data type. In my case I converted the FLOAT data type to NVARCHAR.

SELECT CONVERT(NVARCHAR(255),COLUMN) AS Column_Name
FROM TABLE
WHERE Value = ‘ABC123’

I am then able to query the dataset to my range of data to see the invalid record. I can then run an update statement to correct the values or null them out.

Share

Tim Radney - Database Professional

Tim Radney - Database Professional by Tim Radney I am a Sr DBA for a top 40 US bank. I live in the south eastern US. I have been working with database since 1999 but only full time for the past three years.

Comments

Leave a comment on the original post [timradney.com, opens in a new window]

Loading comments...