Article ID: 280406 - Last Review: October 16, 2003 - Revision: 3.2 PRB: Dynamic Cursor Infinite Loop When a Non-Unique Clustered Index Key Is Updated to an Equal or Larger ValueThis article was previously published under Q280406 SYMPTOMS
A dynamic cursor goes into an infinite loop when a non-unique clustered index key is updated to a value greater than or equal to itself.
CAUSE
For a non-unique clustered index key update, if the new value is greater than or equal to the original value, the update actually deletes the original value and inserts the new value. This adds a new row, which is reflected into the dynamic cursor and causes the @@fetch_status to always return '0'.
WORKAROUND
Define the index as nonclustered instead of clustered.
MORE INFORMATION
This behavior is by design. The following example demonstrates the behavior.
| Article Translations
|
Back to the top
