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

Relational calculus is what type of language?

569


What are the different types of cursor?

599


Thanks to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?

519


Explain something about security and SQL Azure?

88


what is a deadlock? : Sql server database administration

489






Is INSTEAD OF trigger directly applicable to Table ?

564


What are the restraints imposed on the table design by a merge replication?

560


What is Command line parameters in PLSQL.?

576


Can we update data in a view?

592


What triggers long term care?

552


A trigger can reference objects outside the current database? State true or false.

544


What are scheduled tasks in sql server?

535


Does order by actually change the order of the data in the tables or does it just change the output?

645


List some case manipulation functions in sql?

587


What is the difference between lock, block and deadlock? : sql server database administration

558