FIX: Selecting TEXT/IMAGE with Insensitive Cursor May Disconnect (195539)



The information in this article applies to:

  • Microsoft SQL Server 6.5

This article was previously published under Q195539
BUG #: 18280 (SQLBUG_65)

SYMPTOMS

Repeatedly opening an insensitive cursor that selects TEXT or IMAGE columns may cause a handled access violation (AV), resulting in the client being disconnected. This problem only occurs after hundreds of thousands of iterations.

CAUSE

The code for generating worktable IDs, which should always be negative numbers, may occasionally generate a positive value. Permanent tables always have a positive object ID. Due to the positive object ID for a worktable, other paths within the cursor code are treating the table as a permanent table, leading to an access violation.

This bug is not stress-related in any way. A single connection repeatedly opening and closing such a cursor a sufficient number of times may encounter this problem. With a single connection, however, this requires hundreds of thousands of iterations before the first occurrence, and the frequency of occurrence is equally rare.

WORKAROUND

To work around this problem, do either of the following:

  • Use a cursor type other than insensitive when selecting a TEXT or IMAGE column.

    -or-
  • Use the primary key of the table to retrieve the TEXT or IMAGE data only when required in a query outside of the cursor.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 6.5. This problem has been corrected in Service Pack 5a for Microsoft SQL Server 6.5.For more information, click the following article number to view the article in the Microsoft Knowledge Base:

197177 INF: How to Obtain SQL Server 6.5 Service Pack 5a

For more information, contact your primary support provider.

Modification Type:MajorLast Reviewed:3/14/2006
Keywords:kbBug kbfix kbQFE KB195539