Cursors use in SQL Server

A cursor is a database object that helps in accessing and manipulating data in given result set.
The main advantage is that we can process the data row-by -row.

There are four types' cursors.

1. Static:

It always displays the result set as it was when the cursor opened.
Static cursors are always read-only.

2. Dynamic:
Dynamic cursors are opposite of static cursors. It refers all changes made to the rows in their result set when scrolling through the cursor.

3. Forward- Only:
The forward only cursor does not support; it supports
only fetching the rows serially from the start to end of the cursors.

4. Keyset-driven:
The keyset is the set of key values from all the rows that
qualified for the select statement at the time the cursor was opened.

 

Shashi Ray

Ebook Download
View all
Learn
View all