PRB: Cannot Insert Money/Float Larger Than 2147483647 (67407)



The information in this article applies to:

  • Microsoft SQL Server 4.2x

This article was previously published under Q67407

SYMPTOMS

Trying to insert or update a value greater than the largest allowed integer value, 2,147,483,647, into a MONEY or FLOAT field results in the following error message:
The integer value xxx is out of the range of machine representation (4 bytes).

WORKAROUND

A constant of the form 2147483648 is interpreted by SQL Server as an integer. Since the value is being treated as an integer, it cannot exceed the largest legal value for that type.

Either of the following options will resolve this problem:
  1. Add a decimal at the end to have SQL Server recognize the number as a float value: 2147483648.00
  2. Place a dollar sign in front to have SQL Server recognize the number as a money value: $2147483648

Modification Type:MinorLast Reviewed:2/14/2005
Keywords:kbother KB67407