SQL Server Performance Forum – Threads Archive
CursorsDoes the usage of Cursors affect performance of the code?
Microsoft SQL Server MVP
Use cursors only if you need to do things that you cannot do in set-based queries (SELECT, UPDATE, INSERT, DELETE) with JOINs. If you were schooled in a programming language like VB, perhaps you know only how to run a query against a single table, and are not aware of the complex operations you can do in a single T-SQL statement. No need to compare performance between the two: if you have the choice, then set-based is always quicker (and probably easier to program as well), and if you can only do it in a cursor then you’ll just have to accept the performance as it is.
can u provide any link or sample showing set based queries, really it will be interesting to work on performance tuning. Mat
Why not show us what your cursor is doing? Mind you, you might have a situation that can only be addressed with a cursor.
1 In most of the cases cursors should be avoided 2
Cursor seems faster if you generate running totals
http://blogs.sqlservercentral.com/blogs/amachanic/archive/2006/02/28/508.aspx Madhivanan Failing to plan is Planning to fail