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 are the differences between char and varchar in ms sql server?

754


How do triggers work?

692


Can we insert data into view sql server?

716


What are different types of subquery?

908


What is a database in ms sql server?

735






Can an automatic recovery be initiated by a user?

762


How to declare and use cursor variables?

763


Can we use where clause in union?

791


What are the differences between char and nchar in ms sql server?

719


What are data files?

771


When would you use the stored procedures or functions?

746


Explain aggregate functions?

781


Write a program to fetch first 10 records from a file?

759


What are logical database components? : SQL Server Architecture

654


mention different types of relationships in the dbms?

698