FIX: Linked Server Query with Hyphen in LIKE Clause May Run Slower than Expected (275536)
The information in this article applies to:
This article was previously published under Q275536
BUG #: 58361 (SQLBUG_70)
SYMPTOMS
A query that has a LIKE clause, which contains a hyphen character "-", may run slower than expected against a non-SQL Server linked server for a remote table with a large number of rows.
CAUSE
You can use the hyphen character "-" as a pattern match character for ranges in SQL Server (such as [a-z]), but it is not an ANSI SQL standard pattern matching character. SQL Server incorrectly flags the hyphen character "-" as a non-ANSI pattern matching character instead of a literal hyphen ("-") and therefore prevents the criteria from being sent to the remote provider.
WORKAROUND
If the linked server provider supports it, use the OPENQUERY rowset function to force the entire query to be passed to the remote server.
STATUS
Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 3 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base: 274799 INF: How to Obtain Service Pack 3 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
For more information, contact your primary support provider.
Modification Type: | Major | Last Reviewed: | 3/14/2006 |
---|
Keywords: | kbBug kbfix kbQFE KB275536 |
---|
|