Search

wrong result set returned when using order by by carlop

Closed
as Postponed Help for as Postponed

4
1
Sign in
to vote
Type: Bug
ID: 206543
Opened: 9/19/2006 7:04:33 AM
Access Restriction: Public
Duplicates: 206544 355368
0
Workaround(s)
0
User(s) can reproduce this bug
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
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
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
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/27/2006 at 12:24 PM
Hi,

Thank you for bringing this issue to our attention. Although it does not meet the requirements for inclusion in SP2, we will investigate thie issue and, if needed, fix it in a future service pack or release of SQL Server.

Regards,
Tomer Verona
SQL Server Development
Posted by Microsoft on 9/21/2006 at 8:50 AM
Thank-you for taking the time to file this issue. It is under investigation.

SQL Dev.
Sign in to post a workaround.