Re: This is a Nice One (Bug)
From: Steve Kass (skass_at_drew.edu)
Date: 09/25/04
- Next message: J Scott Baltes: "Re: what's wrong"
- Previous message: Hugo Kornelis: "Re: Can a stored procedure have a case statement style structure?"
- In reply to: Tom Jastrzebski: "This is a Nice One (Bug)"
- Messages sorted by: [ date ] [ thread ]
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
>
>
>
>
- Next message: J Scott Baltes: "Re: what's wrong"
- Previous message: Hugo Kornelis: "Re: Can a stored procedure have a case statement style structure?"
- In reply to: Tom Jastrzebski: "This is a Nice One (Bug)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|