Re: This is a Nice One (Bug)

From: Steve Kass (skass_at_drew.edu)
Date: 09/25/04


Date: Sat, 25 Sep 2004 17:51:01 -0400

Tom,

If you were charged for opening case SRX040813601170 about this bug,
please let me know, and I'll bring it up with Microsoft. I don't know
the specific details of Microsoft's support policy, but I believe that
customers are in many cases not charged when the issue turns out to be a
bug. I'd like to know the policy better in terms of when someone might
still be charged.

Knowledge Base article
http://support.microsoft.com/default.aspx?kbid=290817 mentions a
hotfix. Is that the hotfix that does not work in your case? If so, did
product support suggest the workaround also mentioned in that article?
It works for the sample query you provided, at least on version 8.00.818.

Write the innermost subquery with TOP 1 instead of MAX, like this.

select top 1 g.col
from @table g
where g.col = e.col
order by g.col desc

Note that while max() and TOP 1 .. DESC should be the same, that isn't
the case for min() and TOP 1 .. ASC, since TOP 1 can be NULL when min()
is not.

If neither the hotfix nor the workaround solved your problem, can you
post a query for which the workaround fails?

Steve Kass
Drew University

Tom Jastrzebski wrote:

>Hello everybody,
>Try this:
>
>declare @table table(col int)
>
>select a.col
>from @table a
> join (
> select c.col
> from @table c
> join (
> select e.col
> from @table e
> where e.col = (
> select max(g.col)
> from @table g
> where g.col = e.col
> )
> ) d on d.col = c.col
> group by c.col
> ) b on b.col = a.col
>
>I use table variable for simplicity, the problem, Internal SQL Server error,
>occurs with any other type of table or column. Yes I know there is a hotfix
>addressing similar problem. But not this one. And if you happen to hit this
>feature do not call Microsoft - that is MVC Consulting Corp. Waste of time
>and money. I was told it would not be fixed in version 2000 - case
>SRX040813601170.
>
>Tom
>
>keywords: sql server 2000, bug, correlated query, aggregation, aggregate
>
>
>
>



Relevant Pages

  • Re: A bug in MS Access
    ... In the delete query condtion, ... thought this is a bug and searched for the stage to report this.Atlast, ... >>> Microsoft as I was not knowing whom to report. ...
    (microsoft.public.access.modulesdaovba)
  • Re: ADP/2003 sends wrong query to SQL server
    ... then you can keep working while you wait for Microsoft to get back to you. ... Maybe SQL Server would work better for you. ... Access is issueing the wrong query, ... So there must be a bug in Access when putting a Pivotable in a subform.... ...
    (microsoft.public.access.adp.sqlserver)
  • Re: password change prompts even after changing passwords
    ... This problem should be a bug with our product. ... I have sent Hendra the hotfix to address this issue and he ... even i gave permission to microsoft to remote our ...
    (microsoft.public.win2000.active_directory)
  • Re: A bug in MS Access
    ... And also a bug in ADO.Net because of the bug in MS ... THERE IS NO BUG -- all this is expected behaviour according to the way ... Bog-standard parameter query: if you are using VBA, ... Until Microsoft actually release their ...
    (microsoft.public.access.modulesdaovba)
  • Re: A bug in MS Access
    ... I got this bug when I was developing an application with ADO.Net and MS ... queries with an invalid column name, it prompted to enter value for the ... version which I found was 'Microsoft Access 2002SP-1'. ... > the delete query was invalid because it required a parameter. ...
    (microsoft.public.access.modulesdaovba)