Home > DeveloperSection > Interviews > What is cursors?

Posted on    May-03-2011 12:36 AM

 MSSQL Server MSSQL Server 
 1 Answer(s)
  1331  View(s)
Rate this:

Amit Singh

Total Post:565

Posted on    May-03-2011 12:00 AM

Cursor is a database object used by applications to manipulate data in a set on a row-by-row basis, instead of the typical SQL commands that operate on all the rows in the set at one time.

In order to work with a cursor we need to perform some steps in the following order:

Declare cursor
Open cursor
Fetch row from the cursor
Process fetched row
Close cursor
Deallocate cursor

Don't want to miss updates? Please click the below button!

Follow MindStick