FIX: AV on DECLARE CURSOR with Correlated Subquery and KEYSET or DYNAMIC Cursor Type (308881)
The information in this article applies to:
- Microsoft SQL Server 7.0
- Microsoft SQL Server 7.0 Service Pack 1
- Microsoft SQL Server 7.0 Service Pack 2
- Microsoft SQL Server 7.0 Service Pack 3
This article was previously published under Q308881
BUG #: 55675 (sqlbug_70)
SYMPTOMS
SQL Server may encounter an access violation (AV) with a DECLARE CURSOR statement if the following conditions are true:
- A SELECT statement has a correlated subquery.
- The correlation is through an OR clause or IN clause.
- The cursor type must be KEYSET or DYNAMIC.
- There is a nonclustered primary key on both correlated tables.
- The subquery table must not have an additional clustered index.
RESOLUTIONTo resolve this problem, obtain the latest service pack for Microsoft SQL Server 7.0. For additional information, click the following article number to view the article in the
Microsoft Knowledge Base:
301511 INF: How to Obtain the Latest SQL Server 7.0 Service Pack
NOTE: The following hotfix was created prior to Microsoft SQL Server 7.0 Service Pack 4.
The English version of this fix should have the following file attributes or later:
Date Time Version Size File name
-------------------------------------------------------
27-SEP-2001 2:08 7.00.1010 4937KB Sqlservr.exe
NOTE: Because of file dependencies, the most recent hotfix or feature that contains the preceding files may also contain additional files. WORKAROUND
You can work around this problem in the following ways:
- Replace PRIMARY KEY NONCLUSTERED with PRIMARY KEY CLUSTERED.
- Add a clustered index to the correlated subquery table.
- Change cursor type to STATIC, FAST_FORWARD, or INSENSITIVE.
- Rewrite the SELECT to avoid the correlated subquery.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft SQL Server 7.0 Service Pack 4.
Modification Type: | Minor | Last Reviewed: | 9/26/2005 |
---|
Keywords: | kbHotfixServer kbQFE kbbug kbfix kbSQLServ700preSP4fix KB308881 |
---|
|