Click here to Skip to main content
15,921,531 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
what is the use of cursor in database
Posted

1 solution

This is a good example of cursor usage

http://www.mssqltips.com/tip.asp?tip=1599[^]

I generally use them for 'out of hours' or admin based task where the unit of work (e.g. in the above example, a database BACKUP) is very large.

A cursor provides 'row-by-row operations' for your result set, however - there are usually other ways to accomplish the desired functionality - often with much better performance.

Some good info here as well

http://www.sql-server-performance.com/tips/cursors_p1.aspx[^]
 
Share this answer
 
Comments
Sandeep Mewara 21-Feb-11 8:34am    
Right. Good answer. 5!

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