Jul 30, 2020 3:11 pm
Can anyone help what is the user of Cursor ?
1 Reply
Aug 03, 2020 5:09 am
The major function of a cursor is to retrieve data, one row at a time, from a result set, unlike the SQL commands which operate on all the rows in the result set at one time. Cursors are used when the user needs to update records in a singleton fashion or in a row by row manner, in a database table
Cursors are very bad for performance and should be avoided always. Most of the time, cursors can be very easily replaced using joins.
There are different types of cursors in SQL server as listed below.
1.Forward-Only
2.Static
3.Keyset
4.Dynamic