Select the product you need help with
FIX: Incorrect results when you run a FULL JOIN query that uses the CROSS APPLY clause in SQL Server 2008 R2 or in SQL Server 2012Article ID: 2800797 - View products that this article applies to. Microsoft distributes Microsoft SQL Server 2008 R2 Service Pack 2 (SP2) fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 Service Pack 2 fix release. On This PageSymptomsYou may receive incorrect results when you run a query in Microsoft SQL Server 2008 R2 SP2 or in Microsoft SQL Server 2012 when the following conditions are true:
SELECT * FROM tablename
CROSS APPLY (
SELECT * FROM
(SELECT * FROM [dbo].[func_GetTableFromXml](xmlColumn) WHERE nodeParentName = 'New') s1
FULL JOIN
(SELECT * FROM [dbo].[func_GetTableFromXml](xmlColumn) WHERE nodeParentName = 'Old') s2
ON s1.nodeName = s2.nodeName
) s ResolutionCumulative update informationCumulative Update 7 for SQL Server 2012The fix for this issue was first released in Cumulative Update 7. For more information about how to obtain this cumulative update package for SQL Server 2012, click the following article number to view the article in the Microsoft Knowledge Base:2823247 Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/2823247/
)
Cumulative update package 7 for SQL Server 20122692828
(http://support.microsoft.com/kb/2692828/
)
The SQL Server 2012 builds that were released after SQL Server 2012 was releasedCumulative Update 3 for SQL Server 2012 SP1The fix for this issue was first released in Cumulative Update 3. For more information about how to obtain this cumulative update package for SQL Server 2012 SP1, click the following article number to view the article in the Microsoft Knowledge Base:2812412 Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 SP1 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/2812412/
)
Cumulative update package 3 for SQL Server 2012 Service Pack 12772858
(http://support.microsoft.com/kb/2772858/
)
The SQL Server 2012 builds that were released after SQL Server 2012 Service Pack 1 was releasedCumulative Update 5 for SQL Server 2008 R2 SP2The fix for this issue was first released in Cumulative Update 5. For more information about how to obtain this cumulative update package for SQL Server 2008 R2 SP 2, click the following article number to view the article in the Microsoft Knowledge Base:2797460 Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 SP 2 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/2797460/
)
Cumulative update package 5 for SQL Server 2008 R2 Service Pack 22730301
(http://support.microsoft.com/kb/2730301/
)
The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 Service Pack 2 was releasedStatusMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. WorkaroundTo work around this issue, use the FULL MERGE JOIN clause instead of a FULL JOIN clause. For example, you change the query that is mentioned in the "Symptoms" section to that the query resembles the following:
SELECT * FROM tablename
CROSS APPLY (
SELECT * FROM
(SELECT * FROM [dbo].[func_GetTableFromXml](xmlColumn) WHERE nodeParentName = 'New') s1
FULL MERGE JOIN
(SELECT * FROM [dbo].[func_GetTableFromXml](xmlColumn) WHERE nodeParentName = 'Old') s2
ON s1.nodeName = s2.nodeName
) sMore informationFor more information about how to use the CROSS APPLY clause, go to the following Microsoft TechNet website: General information about how to use the CROSS APPLY clause
(http://technet.microsoft.com/en-us/library/ms175156(v=SQL.105).aspx)
PropertiesArticle ID: 2800797 - Last Review: April 15, 2013 - Revision: 3.0 Applies to
| Article Translations
|


Back to the top








