FIX: Incorrect Behavior of LIKE [-] When Using an Index (290918)
The information in this article applies to:
- Microsoft SQL Server 2000 (all editions)
This article was previously published under Q290918
BUG #: 352098 (SHILOH_bugs)
SYMPTOMS
When using a wildcard search on a column containing the value [-], matching rows may be skipped if an index is used.
RESOLUTIONTo resolve this problem, obtain the latest service pack for 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
The correct syntax should include the ESCAPE clause to search for characters that can indicate wildcard searches:
select * from dashes where no_key like 'a[~-]a%' ESCAPE '~'
select * from dashes where primary_key like 'a[~-]a%' ESCAPE '~'
STATUSMicrosoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.
Modification Type: | Major | Last Reviewed: | 11/6/2003 |
---|
Keywords: | kbBug kbfix kbSQLServ2000sp1fix KB290918 |
---|
|