FIX: Poor Performance with Inner Join with Multiple LIKE Clauses Using Variables (225093)
The information in this article applies to:
This article was previously published under Q225093
BUG #: 55032 (SQLBUG_70)
SYMPTOMS
An inner join between two tables with multiple LIKE clauses produces a poor query plan if the LIKE clauses use variables instead of string literals.
WORKAROUND
To work around this use one of the following:
- Replace the variables with string constants.
- Provide a hint to force a loop join. For example, use an INNER LOOP JOIN instead of an INNER JOIN.
- Use the system stored procedure sp_executesql to execute the query, passing the variables as parameters. For syntax details see the Books Online article "sp_executesql (T-SQL)".
STATUS
Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base: 254561 INF: How to Obtain Service Pack 2 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 KB225093 |
---|
|