Microsoft KB Archive/275900

= FIX: Linked Server Query with Hyphen in LIKE Clause May Run Slowly =

Article ID: 275900

Article Last Modified on 10/9/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q275900



BUG #: 236178 (SHILOH_bugs)



SYMPTOMS
A query that has a LIKE clause that contains a hyphen (-) character may run slower than expected against a non-SQL Server data source for a remote table with a large number of rows.



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

Hotfix
NOTE: The following hotfix was created prior to Microsoft SQL Server 2000 Service Pack 1.

The English version of this fix should have the following file attributes or later:   Version      File name      Platform -  8.00.210     s80210i.exe    Intel

NOTE: Due to file dependencies, the most recent hotfix or feature that contains the above files may also contain additional files.



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 that this is a problem in Microsoft SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.



MORE INFORMATION
In this situation, the LIKE clause criteria are applied at the local SQL Server after retrieving all rows from the remote table. So a query such as the following select * from myremoteserver.mycatalog.myschema.mytable where col1 LIKE 'MS-' is processed as follows:
 * All of the rows from &quot;mytable&quot; are retrieved from the linked server to the local SQL Server.
 * The local SQL Server then applies the LIKE clause criteria to produce the final result. Optimally, the remote source handles the application of the criteria so that fewer rows are returned to the local SQL Server.

Keywords: kbbug kbfix kbqfe kbsqlserv2000sp1fix KB275900

-

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

© Microsoft Corporation. All rights reserved.