FIX: Error messages when you run a query that references a view in SQL Server 2005 Service Pack 2: “A severe error occurred on the current command. The results, if any, should be discarded”

Article translations Article translations
Article ID: 938102 - View products that this article applies to.
Bug #: 50001256 (SQL Hotfix)
Expand all | Collapse all

On This Page

SYMPTOMS

Consider the following scenario. You install Microsoft SQL Server 2005 Service Pack 2 (SP2). You run a query that references a view. In this scenario, you receive the following error messages.
Error message 1
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
Error message 2
Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
Additionally, the following error messages are logged in the SQL Server 2005 Errorlog file.
Error message 1
Date Time Server Error: 17310, Severity: 20, State: 1.
Error message 2
Date Time Server A user request from the session with SPID 51 generated a fatal exception.
This problem occurs if the following conditions are true:
  • The query references a view that uses non-ANSI outer join operators. For example, the view uses the *= operator or the =* operator.
  • The column list of the SELECT statement in the view contains a subquery.
  • The version of SQL Server 2005 is SQL Server 2005 SP2 or a later version.
  • You set the database of SQL Server 2005 to use compatibility level 80.

RESOLUTION

Cumulative update information

The fix for this issue was first released in Cumulative Update 2. For more information about how to obtain this cumulative update package for SQL Server 2005 Service Pack 2, click the following article number to view the article in the Microsoft Knowledge Base:
936305 Cumulative update package 2 for SQL Server 2005 Service Pack 2
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 2005 fix release. Microsoft recommends 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:
937137 The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 2 was released
Microsoft SQL Server 2005 hotfixes are created for specific SQL Server service packs. You must apply a SQL Server 2005 Service Pack 2 hotfix to an installation of SQL Server 2005 Service Pack 2. By default, any hotfix that is provided in a SQL Server service pack is included in the next SQL Server service pack.

WORKAROUND

To work around this problem, modify the view to use ANSI outer join operators. For example, use the LEFT OUTER JOIN operator or the RIGHT OUTER JOIN operator.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Properties

Article ID: 938102 - Last Review: June 20, 2007 - Revision: 1.4
APPLIES TO
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Standard X64 Edition
  • Microsoft SQL Server 2005 Standard Edition for Itanium-based Systems
  • Microsoft SQL Server 2005 Enterprise X64 Edition
  • Microsoft SQL Server 2005 Enterprise Edition for Itanium-based Systems
  • Microsoft SQL Server 2005 Workgroup Edition
Keywords: 
kbsql2005engine kbexpertiseadvanced kbpubtypekc kbqfe kbfix KB938102

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