Microsoft KB Archive/248618

From BetaArchive Wiki
Knowledge Base


FIX: SQL Server Returns Incorrect Value for a Bit Field When You Use a Static Cursor On Joined Tables

Article ID: 248618

Article Last Modified on 3/14/2006



APPLIES TO

  • Microsoft SQL Server 7.0 Standard Edition



This article was previously published under Q248618

BUG #: 55430 (SQLBUG_70)

SYMPTOMS

SQL Server may return an incorrect value for a bit field when you use a static cursor on joined tables. The join type can be left or right.

Several places in the SQL Server 7.0 worktable code, SQL Server does not handle bit columns correctly when you set the value to NULL.

You can reproduce this problem in an ActiveX Data Objects (ADO) recordset by using a server-side cursor or a stored procedure that uses a Transact-SQL cursor.

CAUSE

When more than one bit column is present, the SetData code calls the SetNull function for null bit columns, and overwrites the entire byte, wiping out values for any previously set bit columns in that byte.

WORKAROUND

Re-order the output to make sure that the nullable bit column is projected before the non-null column.

STATUS

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

254561 INF: How to Obtain Service Pack 2 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0


For more information, contact your primary support provider.

Keywords: kbbug kbfix kbqfe KB248618