Groups | Blog | Home
all groups > sql server (alternate) > july 2003 >

sql server (alternate) : Updatable Cursors



Rajah Venkata Krishnan
7/18/2003 3:17:24 PM
I am trying to write updatable cursors in a stored procedure? Can I get
any help to write updatable cursors?

Any help would be appreciated very much.

Thanks for your help in advance.

Rajah V.



*** Sent via Developersdex http://www.developersdex.com ***
Anith Sen
7/18/2003 6:44:58 PM
Can you post some sample data along with table DDLs so that others can
better understand your requirements? Most likely you can use efficient
set-based logic & avoid cursors which are generally lousy, slow & resource
intensive.

--
- Anith
( Please reply to newsgroups only )

Erland Sommarskog
7/18/2003 10:00:44 PM
Rajah Venkata Krishnan (rajah.venkat@analytics-usa.com) writes:
[quoted text, click to view]

As Anith, I discourage you from writing cursors. Cursors have their
place, but it is a feature which you should use rarely. The performance
of cursor compare to the corresponding set-based operation is often
magntitudes slower.

If you have a problem which actually is best addressed by a cursor, don't
bother using WHERE CURRENT OF. Make the cursor INSENSITIVE, and update
the rows through key values. I have *never* had any need for WHERE CURRENT
OF.


--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
AddThis Social Bookmark Button