Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Please tel me
What is the need for using cursor?
what is the advantage of using cursor?
Posted

Hi,

Cursor is basically a pointer which help us to iterate through the rows of the specified record set. refer below articles for more on cursors.

SQL Server Basics of Cursors[^]
Cursors[^]
SQL Server Different Types of Cursors[^]
What is cursor in SQL Server?[^]
Cursors: An Overview[^]

hope it helps.
 
Share this answer
 
Comments
Rohit Kolekar11 1-Mar-13 5:38am    
Thanks....
Karthik Harve 1-Mar-13 5:40am    
Welcome.! happy coding.
fjdiewornncalwe 1-Mar-13 17:39pm    
+5.
Karthik Harve 1-Mar-13 23:44pm    
Thanks.!
hi,

Cursor is nothing but a for loop concept. While you returning some recordset and doing functionality with the same procedure. As the basic advise dont use cursor. It creates lot of performance issue. Executing time is getting more while used cursors. Main disadvantage is it allocates lot of memory on server. Better use temp table concept to avoid cursors.


Regards,
Prakash.T
 
Share this answer
 
Comments
Rohit Kolekar11 1-Mar-13 5:38am    
Thanks...
 
Share this answer
 
Comments
Rohit Kolekar11 1-Mar-13 5:39am    
Thanks...
 
Share this answer
 
Comments
Rohit Kolekar11 1-Mar-13 5:38am    
Thanks...
AshishChaudha 1-Mar-13 23:39pm    
Welcome rohit...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900