what are the disadvantages of cursors in a store procedure?

Posted by Rajendra.prasad under Sql Server on 5/12/2011 | Points: 10 | Views : 3222 | Status : [Member] | Replies : 2
Hi,
what are the disadvantages of cursors in a store procedure?

Regards,
Rajendra




Responses

Posted by: Vinith on: 5/12/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,
Hope the below links will help you..

http://www.dotnetfunda.com/interview/exam602-what-are-the-disadvantageslimitation-of-the-cursor-.aspx
http://www.careerride.com/sqlserver-limitation-of-cursor.aspx

Thanks

Vinith Anthony

Rajendra.prasad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Msahoo on: 5/12/2011 [Member] Starter | Points: 25

Up
0
Down
Each time a row is fetched from the cursor, it results in a network roundtrip; where as a normal SELECT query makes only one roundtrip, however large the result set 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.

Thank You.

Regards,
Manoranjan Sahoo
http://www.dotnetsquare.com

Rajendra.prasad, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response