Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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”


Bug #: 50001256 (SQL Hotfix)

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


Status

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

↑ Back to the top


Keywords: kbnotautohotfix, kbsql2005engine, kbexpertiseadvanced, kbpubtypekc, kbqfe, kbfix, kb

↑ Back to the top

Article Info
Article ID : 938102
Revision : 4
Created on : 5/10/2018
Published on : 5/10/2018
Exists online : False
Views : 79