Error 220

Severity Level 16
Message Text

Arithmetic overflow error for data type %ls, value = %ld.

Explanation

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

  

Action

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

  

See Also
Data Types Errors 1 - 999
CAST and CONVERT ROUND

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.