Microsoft KB Archive/308370

= FIX: Query Containing LIKE NULL May Not Return Correct Results =

Article ID: 308370

Article Last Modified on 10/16/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q308370



BUG #: 355085 (SHILOH_BUGS)



SYMPTOMS
When you run a query containing LIKE NULL as one of the OR operands, the query may return no results even though there are rows satisfying other OR predicates. For example: SELECT * FROM pubs.dbo.authors WHERE au_lname = 'White' OR       au_fname like NULL



RESOLUTION
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



WORKAROUND
Replace LIKE NULL with IS NULL.



STATUS
Microsoft has confirmed that this is a problem in Microsoft SQL Server 2000. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 2.

Keywords: kbbug kbfix kbsqlserv2000presp2fix KB308370

-

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

© Microsoft Corporation. All rights reserved.