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: Incorrect native SQL error information when you use SQLXML to retrieve data


View products that this article applies to.


Important This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:
256986 (http://support.microsoft.com/kb/256986/ ) Description of the Microsoft Windows Registry

↑ Back to the top


Symptoms

Applications that use SQLXML to retrieve data from a Microsoft SQL Server stored procedure may encounter incorrect native SQL Server error information. Native SQL Server error related fields such as HRESULT, SQLSTATE, Native Error, Error state, and Severity may contain incorrect results.

↑ Back to the top


Cause

SQLXML does not return correct native SQL Server error values for SQLSTATE, Native Error, Error state, and Severity.

↑ Back to the top


Resolution

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: Note 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 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-Aug-2003  16:39  2000.81.9041.45   200,704  Sqlxmlx.dll      
   29-Aug-2003  16:39  2000.81.9041.45    28,672  Sqlxmlx.rll
				

Note For a list of all the hotfixes available for MDAC 2.8, click the following article number to view the article in the Microsoft Knowledge Base:
839801� FIX: Hotfixes are available for MDAC 2.8

↑ 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


More information

In general, this SQLXML hotfix will cause the return of the correct SQL native error. However, to retrieve the correct HRESULT information, follow these steps:
  1. Locate the following registry key:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\SQLXMLX
  2. Create the DWORD value ReportErrorsWithSQLInfo.
  3. Set ReportErrorsWithSQLInfo to 1.
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk. When the stored procedure returns an error that the stored procedure failed because of a deadlock, the following values are returned:
  • HRESULT = 0X40EDA
  • SQLSTATE = (null)
  • Native Error = -2147467259
  • Error state = 1
  • Severity = 16
  • Source = Microsoft OLE DB Provider for SQL Server
  • Error Message = Transaction (Process ID XXX) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
In this case, the values for SQLSTATE, Native Error, Error State and Severity are incorrect. The correct values that you receive after you install the hotfix are as follows:
  • HRESULT = 0X40EDA
  • SQLSTATE = 40001
  • Native Error = 1205
  • Error state = 50
  • Severity =13
  • Source = Microsoft OLE DB Provider for SQL Server
  • Error Message = Transaction (Process ID XXX) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

↑ Back to the top


Keywords: KB826770, kbbug, kbfix, kbhotfixserver, kbqfe, kbautohotfix

↑ Back to the top

Article Info
Article ID : 826770
Revision : 7
Created on : 11/15/2007
Published on : 11/15/2007
Exists online : False
Views : 582