Article ID: 826770 - Last Review: November 15, 2007 - Revision: 5.2

FIX: Incorrect native SQL error information when you use SQLXML to retrieve data

Hotfix download is availableHotfix Download Available
View and request hotfix downloads

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
Expand all | Collapse all

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.

CAUSE

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

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:
http://support.microsoft.com/contactus/?ws=support (http://support.microsoft.com/contactus/?ws=support)
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  (http://support.microsoft.com/kb/839801/ ) FIX: Hotfixes are available for MDAC 2.8

STATUS

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

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.

APPLIES TO
  • SQLXML 2.6 SP2
  • Microsoft Data Access Components 2.7 Service Pack 1
Keywords: 
kbautohotfix kbqfe kbhotfixserver kbfix kbbug KB826770
 

Article Translations