Advantages and Disadvantages of Cursor?

Answer Posted / sarat

Cursors allow row-by-row processing of the resultsets.

Disadvantages of cursors: Each time you fetch a row from the
cursor, it results in a network roundtrip, where as a normal
SELECT query makes only one rowundtrip, however large the
resultset is. Cursors are also costly because they require
more resources and temporary storage (results in more IO
operations). Further, there are restrictions on the SELECT
statements that can be used with some types of cursors.

Most of the times, set based operations can be used instead
of cursors.

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a self join in sql server?

600


What are the five major components of a dbms?

514


What are various aggregate functions that are available?

508


What is check constraint in sql server?

525


What are null values in ms sql server?

560






Suppose you want to implement the one-to-many relationships while designing tables. How would you do it?

509


What is the use of “join” in sql server?

574


What is the purpose of self join?

505


What do you mean by a Composite primary key?

598


Mention a few common trace flags used with sql server?

544


Which are new data types introduced in sql server 2008?

605


What is updatable resultset?

518


What is the difference between varchar and nvarchar datatypes?

574


What is dbcc? Give few examples.

582


Are there issues when exporting SSRS reports into Microsoft Excel? When my users are trying to export a SSRS report into Microsoft Excel, one or two columns in the report appear to merge together. Why might this be?

134