FIX: A query that references a view that uses UNION operator may return incorrect results

Article translations Article translations
Article ID: 326810 - View products that this article applies to.
This article was previously published under Q326810
Bug #: 361320 (SQL Server 8.0)
Expand all | Collapse all

On This Page

SYMPTOMS

When you run a query, the query may return results that are not correct if all the following conditions are true:
  • The query execution plan contains the Distinct Sort logical operator, and the Distinct Sort logical operator is on a Join logical operator.
  • The Join logical operator is on a Rank logical operator.
This problem may occur if the query references a view that uses the Union logical operator to perform a join between two or more tables.

RESOLUTION

Service pack information

To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000 Analysis Services. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
290211 INF: How to obtain the latest SQL Server 2000 service pack

Hotfix information

The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date      Time   Version    Size    File name
   --------------------------------------------------
   29-Jul-02 15:38  8.00.665 7,462,996 Sqlservr.exe
				
Note Because of file dependencies, the most recent hotfix or feature that contains these files may also contain additional files.

WORKAROUND

To work around the problem, perform one of the following actions:
  • Re-create the underlying view to use the DISTINCT operator and the UNION ALL operator instead of the UNION operator in the view definition query.
  • Force the query execution plan to use a LOOP JOIN hint, a MERGE JOIN hint, or a HASH JOIN hint by using the OPTION(Join Type Hint) clause in the query.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article.
This problem was first corrected in SQL Server 2000 Analysis Services Service Pack 3.

Properties

Article ID: 326810 - Last Review: September 27, 2005 - Revision: 3.2
APPLIES TO
  • Microsoft SQL Server 2000 Standard Edition
Keywords: 
kbhotfixserver kbqfe kbsqlserv2000sp3fix kbdatabase kbview kbquery kbbug kbfix KB326810

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com