FIX: Dynamic cursor retrieves the same row two times when you update the non-clustered index key to the same value

This article has been archived. It is offered "as is" and will no longer be updated.
SYMPTOMS
A dynamic cursor retrieves the same row two times when all the following conditions are true:
  • The dynamic cursor has an order-by clause that matches a non-clustered index.
  • One or more key columns is updated to the same value that the column currently has. The key columns in the non-clustered index are used to specify order.
  • One or more key columns can be assigned a null value,
RESOLUTION

Service pack information

To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
290211 How to obtain the latest SQL Server 2000 service pack

Hotfix information

The English version of this hotfix has the file attributes (or later file attributes) 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   --------------------------------------------------------------   08-Jun-2004  17:14  2000.80.949.0     664,128  Autoplt.dll         08-Jun-2004  17:14  2000.80.949.0      78,400  Console.exe         08-Jun-2004  17:14  2000.80.949.0     315,968  Custtask.dll        08-Jun-2004  17:14  2000.80.949.0      33,340  Dbmslpcn.dll        08-Apr-2004  21:42                    786,432  Distmdl.ldf   08-Apr-2004  21:42                  2,359,296  Distmdl.mdf   10-Oct-2003  18:48                        180  Drop_repl_hotfix.sql   08-Jun-2004  17:14  2000.80.949.0   1,905,216  Dtspkg.dll          08-Jun-2004  17:14  2000.80.949.0     528,960  Dtspump.dll         08-Jun-2004  17:14  2000.80.949.0   1,557,052  Dtsui.dll           08-Jun-2004  17:14  2000.80.949.0     639,552  Dtswiz.dll          10-Oct-2003  18:48                    747,927  Instdist.sql   10-Oct-2003  18:48                      1,581  Inst_repl_hotfix.sql   08-Jun-2004  17:14  2000.80.949.0     352,828  Isqlw.exe           08-Jun-2004  17:14  2000.80.949.0      82,492  Itwiz.exe           08-Jun-2004  17:14  2000.80.949.0      90,692  Msgprox.dll         19-May-2004  23:43  8.11.40209.0      209,408  Mssdi98.dll         08-Jun-2004  17:14  2000.80.949.0      62,024  Odsole70.dll        08-Jun-2004  17:15  2000.80.949.0      25,144  Opends60.dll        08-Jun-2004  17:16                     82,944  Opends60.pdb   08-Jun-2004  17:14  2000.80.949.0      57,904  Osql.exe            08-Jun-2004  17:14  2000.80.949.0     279,104  Pfutil80.dll        10-Oct-2003  18:37                    550,780  Procsyst.sql   08-Apr-2004  21:42                     12,305  Qfe469315.sql   08-Apr-2004  21:42                     19,195  Qfe469571.sql   08-Jun-2004  15:52                  1,104,848  Replmerg.sql   08-Jun-2004  17:14  2000.80.949.0     221,768  Replprov.dll        08-Jun-2004  17:14  2000.80.949.0     307,784  Replrec.dll         08-Jun-2004  16:12  2000.80.949.0     159,813  Replres.rll   10-Oct-2003  18:48                  1,087,150  Replsys.sql   10-Oct-2003  18:48                    986,603  Repltran.sql   08-Jun-2004  17:14  2000.80.949.0     287,304  Rinitcom.dll        08-Jun-2004  17:14  2000.80.949.0      78,416  Sdiclnt.dll         08-Jun-2004  17:14  2000.80.949.0      66,112  Semmap.dll          08-Jun-2004  17:14  2000.80.949.0      57,916  Semnt.dll           08-Jun-2004  17:14  2000.80.949.0     492,096  Semobj.dll          08-Jun-2004  16:37  2000.80.949.0     172,032  Semobj.rll   08-Jun-2004  17:14  2000.80.949.0      53,832  Snapshot.exe        12-Mar-2004  03:10                    117,834  Sp3_serv_uni.sql   08-Jun-2004  17:13  2000.80.949.0      28,672  Sqlagent.dll        08-Jun-2004  17:14  2000.80.949.0     311,872  Sqlagent.exe        08-Jun-2004  17:13  2000.80.949.0     168,001  Sqlakw32.dll        08-Jun-2004  17:15  2000.80.949.0      33,344  Sqlctr80.dll        08-Jun-2004  17:15  2000.80.949.0   4,215,360  Sqldmo.dll          08-Jun-2004  17:14                     25,172  Sqldumper.exe       08-Jun-2004  15:49  2000.80.949.0      28,672  Sqlevn70.rll   08-Jun-2004  17:15  2000.80.949.0     180,792  Sqlmap70.dll        08-Jun-2004  17:15  2000.80.949.0     188,992  Sqlmmc.dll          08-Jun-2004  16:41  2000.80.949.0     479,232  Sqlmmc.rll   08-Jun-2004  17:15  2000.80.949.0     401,984  Sqlqry.dll          08-Jun-2004  17:15  2000.80.949.0      57,920  Sqlrepss.dll        08-Jun-2004  17:15  2000.80.949.0   7,581,777  Sqlservr.exe        08-Jun-2004  17:15                 13,050,880  Sqlservr.pdb   08-Jun-2004  17:15  2000.80.949.0     590,396  Sqlsort.dll         08-Jun-2004  17:15  2000.80.949.0      45,644  Sqlvdi.dll          08-Jun-2004  17:15  2000.80.949.0     106,588  Sqsrvres.dll        08-Jun-2004  17:15  2000.80.949.0      33,340  Ssmslpcn.dll        08-Jun-2004  17:15  2000.80.949.0      82,492  Ssnetlib.dll        08-Jun-2004  17:15  2000.80.949.0      25,148  Ssnmpn70.dll        08-Jun-2004  17:15  2000.80.949.0     123,456  Stardds.dll         08-Jun-2004  17:15  2000.80.949.0     158,240  Svrnetcn.dll        08-Jun-2004  17:14  2000.80.949.0      76,416  Svrnetcn.exe        08-Jun-2004  17:15  2000.80.949.0      49,228  Ums.dll             08-Jun-2004  17:15                    132,096  Ums.pdb   08-Jun-2004  17:15  2000.80.949.0      98,872  Xpweb70.dll                                         
WORKAROUND
To work around this problem, use one of the following methods:

Method 1

Switch to another cursor type instead of the dynamic-cursor type.

Method 2

Do not update any one of the key columns of the non-clustered index.

Method 3

Use DBCC DBREINDEX. DBCC DBREINDEX sets the correct value for the null-block column.

Method 4

Determine the dynamic cursor position with an order-by clause. Now, only the key columns of the index are compared instead of the whole index row.
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 4.
REFERENCES
For additional information, visit the following Microsoft Developer Network (MSDN) Web sites:

Using non-clustered indexesDynamic cursors For more information, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates
Properties

Article ID: 843267 - Last Review: 01/17/2015 10:49:25 - Revision: 2.5

  • Microsoft SQL Server 2000 Developer Edition
  • Microsoft SQL Server 2000 Standard Edition
  • Microsoft SQL Server 2000 Enterprise Edition
  • Microsoft SQL Server 2000 Personal Edition
  • Microsoft SQL Server 2000, Workgroup Edition
  • Microsoft SQL Server 2000 Desktop Engine (Windows)
  • Microsoft SQL Server 2000 Enterprise Edition 64-bit
  • kbnosurvey kbarchive kbfix kbbug kbcursor kbhotfixserver kbqfe KB843267
Feedback