Consider the following scenario. In Microsoft SQL Server 2005, you run a query that uses the LIKE operator. The execution plan of the query uses the GetRangeThroughConvert function. When you run the query, you may receive an incorrect result. For example, the execution plan for this query may resemble the following.
|--Nested Loops(Inner Join, OUTER REFERENCES:([Expr1010], [Expr1011],
| |--Compute Scalar(DEFINE:(([Expr1005],[Expr1006],[Expr1004])=GetRangeThroughConvert(N'P08.89',NULL,(22))))
| | |--Constant Scan
| |--Compute Scalar(DEFINE:(([Expr1008],[Expr1009],[Expr1007])=GetRangeThroughConvert(NULL,N'P08.8?',(10))))
| |--Constant Scan
SEEK:( [TestLikeBug].[dbo].[Projects].[ProjectNumber] > [Expr1010] AND
[TestLikeBug].[dbo].[Projects].[ProjectNumber] < [Expr1011]),
WHERE:(CONVERT_IMPLICIT(nvarchar(12),[TestLikeBug].[dbo].[Projects].[ProjectNumber],0) like N'P08.89%')
This issue occurs because SQL Server generates an incorrect range condition for the LIKE operator.
Service pack informationTo resolve this problem, obtain the latest service pack for SQL Server 2005. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
913089 How to obtain the latest service pack for SQL Server 2005
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in SQL Server 2005 Service Pack 3.
For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates
Makale No: 959019 - Son İnceleme: 15 Ara 2008 - Düzeltme: 1