Arithmetic overflow error for data type %ls, value = %ld.
This error occurs when an attempt is made to convert a float or real data type value into a data type that cannot store the result. This error prevents the operation from being completed. For example, if you attempt to place the number 32770 into a variable or column of smallint data type, Microsoft® SQL Server™ returns this error because variables or columns of smallint data type can address integers from 2^15 (–32,768) through 2^15 (32,767).
This example raises the error:
DECLARE @myval smallint
SET @myval = 32770
SELECT @myval
GO
For numeric operations, use the ROUND, CAST, and CONVERT functions to manipulate the value in question to fit into the column or variable. Change the data type of the column or variable in question. In the example described above, change the column or variable from smallint to int).
Here is the corrected example:
DECLARE @myval int
SET @myval = 32770
SELECT @myval
GO
Data Types | Errors 1 - 999 |
CAST and CONVERT | ROUND |