What are cursors? Name four types of cursors and when each
one would be applied?

Answer Posted / sreyasmn

Cursors can be either updateable or non-updateable. If you
only need to display information and not diddle with it,
the non-updateable is the fastest. The provider simply
passes you the data and forgets about it! There is no need
to keep tabs on the data to see if it has been changed.
Therefore, this is the fastest cursor to use.



Cursor type

Static cursor. This is the one to use for generating
reports or finding data. Additions, changes, or deletions
by other users are not visible

Forward-only cursor. This is the default. It is identical
to the Static except that you can only scroll forward. The
fastest cursor this side of the Pecos Mountains.

Dynamic cursor. Additions and deletions by others are
visible. All movement is supported. But some providers
don't support this cursor type.

Keyset-driven cursor. This is similar to a Dynamic cursor
except you can't see records others add. If another user
deletes a record, it is inaccessible from your recordset

Is This Answer Correct ?    46 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to list all stored procedures in the current database using ms sql server?

628


How to transfer data from a cursor to variables with a "fetch" statement?

579


How do you delete duplicate records in sql server?

500


What are temporal tables in sql server 2016?

472


What is a fill factor?

613






How to find Duplicate Records In table?

579


Explain tables in SQL Azure?

94


You have a table ‘test’ which is a copy of northwind employee table you have written a trigger to update the field ‘hiredate’ with the current date

590


What is the security model used in sql server 2005?

503


What is the architecture of ms sql reporting service?

515


What is a table called, if it has neither cluster nor non-cluster index? What is it used for?

587


What is system stored procedures?

577


What is the difference between varchar and nvarchar?

516


What are sql server procedures?

537


What is the full meaning of dml?

517