That cursor shouldn't need a check against -2 as it is a read-only cursor. But if you have a key-set
driven cursor (SQL Server stored only the primary key, when fetching, SQL Server uses the PK to
fetch the other columns, you might end up navigating to a row which has been deleted in the table.
Hence @@FETCH_STATUS = -2.
driven cursor (SQL Server stored only the primary key, when fetching, SQL Server uses the PK to
fetch the other columns, you might end up navigating to a row which has been deleted in the table.
Hence @@FETCH_STATUS = -2.
No comments:
Post a Comment