Microsoft KB Archive/942904

= FIX: Error message when you run the DBCC CHECKTABLE statement or the DBCC CHECKDB statement in Microsoft SQL Server 2005: &quot;Column '' value is out of range for data type 'float'&quot; =

Article ID: 942904

Article Last Modified on 11/14/2007

-

APPLIES TO


 * Microsoft SQL Server 2005 Standard Edition
 * Microsoft SQL Server 2005 Developer Edition
 * Microsoft SQL Server 2005 Enterprise Edition
 * Microsoft SQL Server 2005 Enterprise X64 Edition
 * Microsoft SQL Server 2005 Enterprise Edition for Itanium-based Systems
 * Microsoft SQL Server 2005 Standard X64 Edition
 * Microsoft SQL Server 2005 Standard Edition for Itanium-based Systems

-



Bug: #50001847 (SQL Hotfix)



Microsoft distributes Microsoft SQL Server 2005 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release.



SYMPTOMS
In Microsoft SQL Server 2005, when you run the DBCC CHECKTABLE statement or the DBCC CHECKDB statement to perform a physical consistency check on a table, you receive an error message that resembles the following error message:

DBCC results for ' represents the actual name of the table, and   represents the actual name of the column.



CAUSE
This problem occurs because an INSERT statement or an UPDATE statement passes values that are out of range into a column that is a FLOAT data type column. This condition may occur if the INSERT statement or the UPDATE statement does not send the values that are inserted or that are updated as literals. For example, this issue may occur if you use a variable to pass an invalid value into an INSERT statement or into an UPDATE statement.



RESOLUTION
The fix for this issue was first released in Cumulative Update 4. For more information about how to obtain this cumulative update package for SQL Server 2005 Service Pack 2, click the following article number to view the article in the Microsoft Knowledge Base:

941450 Cumulative update package 4 for SQL Server 2005 Service Pack 2

Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release. Microsoft recommends that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

937137 The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 2 was released

Microsoft SQL Server 2005 hotfixes are created for specific SQL Server service packs. You must apply a SQL Server 2005 Service Pack 2 hotfix to an installation of SQL Server 2005 Service Pack 2. By default, any hotfix that is provided in a SQL Server service pack is included in the next SQL Server service pack.

For more information about what files are changed, and for information about any prerequisites to apply the cumulative update package that contains the hotfix that is described in this Microsoft Knowledge Base article, click the following article number to view the article in the Microsoft Knowledge Base:

941450 Cumulative update package 4 for SQL Server 2005 Service Pack 2



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
After you apply this hotfix, SQL Server does not prevent you from entering invalid values in columns that are FLOAT data type columns. After you apply this hotfix, the invalid values are not indicated as errors in the DBCC CHECKTABLE statement or in the DBCC CHECKDB statement.

Steps to reproduce the problem
 Open SQL Server Management Studio, and then connect to an instance of SQL Server 2005.  Create a new query, and then run the following statements: create table tb1 (c float) go

declare @f float set @f=1E-307*0.01 insert tb1 values (@f) go select * from tb1 go Notice that the following invalid value has been inserted into the table:

1E-309

  Run the following statements: DBCC CHECKTABLE ('tb1') go You receive the error message that the &quot;Symptoms&quot; section describes.   Run the following statements: insert tb1 values (1E-309) go You receive one of the following messages, depending on the SQL Server build:

Message 1

Warning: the floating point value '1E-309' is too small. It will be interpreted as 0.

Message 2

The floating point value '1E-309' is out of the range of computer representation (8 bytes).

In this case, the invalid value is not inserted into the table because you send the value as a literal. </li>  Run the following statements to examine the value that is inserted into the table in step 4: select * from tb1 go Notice that 0 is inserted instead of the invalid value. </li></ol>

<div class="references_section">