FIX: SELECT May Not Return All Rows if It Contains a Large Number of Values in an IN Clause on a NUMERIC Column

Article translations Article translations
Article ID: 278978 - View products that this article applies to.
This article was previously published under Q278978
BUG #: 57999 (SQLBUG_70)
BUG #: 235838 (SHILOH_BUGS)
Expand all | Collapse all

On This Page

SYMPTOMS

A SELECT statement may not return all the rows that satisfy a WHERE clause if all of the following conditions are met:
  • If there are a large number of values in the IN clause of that SELECT statement.
  • If the datatype of the column used in the IN clause is NUMERIC.
  • If the execution plan for the SELECT statement shows a "Constant Scan".

RESOLUTION

SQL Server 2000

To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack

SQL Server 7.0

To resolve this problem, obtain the latest service pack for SQL Server 7.0. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
301511 INF: How to Obtain the Latest SQL Server 7.0 Service Pack

WORKAROUND

Use the query hint OPTION ( fast n ) in the SELECT statement. For more information on query hints, see the "SELECT (T-SQL)" topic in SQL Server 7.0 and SQL Server 2000 Books Online.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

SQL Server 2000

This problem was first corrected in SQL Server 2000 Service Pack 1.

SQL Server 7.0

This problem was first corrected in SQL Server 7.0 Service Pack 3.

Properties

Article ID: 278978 - Last Review: October 31, 2003 - Revision: 3.2
APPLIES TO
  • Microsoft SQL Server 2000 Standard Edition
  • Microsoft SQL Server 7.0 Standard Edition
Keywords: 
kbbug kbfix kbsqlserv2000sp1fix KB278978

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com