Microsoft KB Archive/278978

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

Article ID: 278978

Article Last Modified on 10/31/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition
 * Microsoft SQL Server 7.0 Standard Edition

-



This article was previously published under Q278978



BUG #: 57999 (SQLBUG_70)

BUG #: 235838 (SHILOH_BUGS)



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 &quot;Constant Scan&quot;.



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 &quot;SELECT (T-SQL)&quot; 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.

Additional query words: IN incorrect

Keywords: kbbug kbfix kbsqlserv2000sp1fix KB278978

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.