Article ID: 321541 - View products that this article applies to.
This article was previously published under Q321541
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 357109 (SHILOH_BUGS)
SQL Server returns incorrect results in a particular scenario that involves a query with an outer join and a view.
You can reproduce the behavior when all the following conditions exist:
An incorrect view resolution is causing the problem.
When the condition in the first bullet item of the "Symptoms" section is true, the inlining process will involve pulling all result expressions of the view from under the outer join to be computed above the outer join.
When the condition in the second bullet item of the "Symptoms" section is true, this pulling is semantically incorrect and will lead to incorrect results.
When the condition in the third bullet item of the "Symptoms" section is true, the view resolution code will inline the view tree in the query.
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
290211NOTE: The following hotfix was created before the release of Microsoft SQL Server 2000 Service Pack 3.
(http://support.microsoft.com/kb/290211/EN-US/ )INF: How To Obtain the Latest SQL Server 2000 Service Pack
A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.
If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.
Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=supportNote The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language. The English version of this fix should have the following file attributes or later:
NOTE: Because of file dependencies, the most recent hotfix or feature that contains the files may also contain additional files.
Date Version Size File name ------------------------------------------------ 04/20/2002 8.00.613 7,281 KB Sqlservr.exe
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
This problem was first corrected in Microsoft SQL Server 2000 Service Pack 3.
To reproduce the problem, use the following script:
The script returns this result:
This is the result the SELECT statement is supposed to return: