Search

-- duplicated, please ignore --- wrong result set returned when using order by by carlop

Closed
as Postponed Help for as Postponed

0
0
Sign in
to vote
Type: Bug
ID: 206544
Opened: 9/19/2006 7:05:06 AM
Access Restriction: Public
Primary Feedback Item: 206543
0
Workaround(s)
0
User(s) can reproduce this bug
-- duplicated, please ignore ---
I've found a combination of data into a query that produces wrong result: the query is basically the same but returns different recordsets
Details (expand)
Product Language
English

Version

SQL Server 2005 SP1 - Express Edition

Category

SQL Engine

Operating System

Windows XP SP2 Professional
Operating System Language
Not Applicable
Steps to Reproduce
-- duplicated, please ignore ---
Run the following three statements against the databese I've attached with the testdb.zip file:

1>
Select * from FSupporti with (nolock)
where Cod_Supp like N'089%'

2>
Select * from FSupporti with (nolock)
where Cod_Supp like N'089%'
order by Cod_Supp

3>
Select * from FSupporti with (nolock)
where Cod_Supp like '089%'
order by Cod_Supp

4>
Select * from FSupporti with (nolock)
where Cod_Supp like N'0%'
order by Cod_Supp



Actual Results
-- duplicated, please ignore ---
The 2nd query returns an empty recordset while the other two does not.
This seems a clear bug to me since the only difference between the two queries is an order by.

Now please look carefully at the 4th query: it is == to the 2nd except for the data to be compared, and this query returns a non-empty recordset.
Bug ?


Expected Results
-- duplicated, please ignore ---
The 2nd query should return a result set.

Platform

32
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 9/21/2006 at 8:48 AM
Closing the duplicate of 206543.
Sign in to post a workaround.