dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Enterprise
Expertise: All
Oct 7, 1999

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Select Proper Cursor and Lock Types

You can improve performance of your ADO applications by properly selecting the Cursor and Lock Types while opening the recordsets. Cursor Type indicates the type of the cursor the provider should use when opening the recordset. This may be changed by the provider if the cursor type is not supported. Lock Type specifies the type of locking that the provider should use when opening the recordset.

If you are using SQL Server and server side cursors, then dynamic or forward only cursor types are more efficient when selecting the data. This is because the data is not copied into tempdb first. The keyset and static cursors require a copy of data to be put into tempdb in the SQL Server before the cursor is created. If you use SQL Trace, you will find a lot more activity for keyset and static cursors. As the number of rows will increase in the recordset the usage of keyset and static cursors will reduce the performance of the application.

The only advantage/disadvantage with forward-only cursors is that cursor movement can only be made one row at a time in a forward direction. If you are not going to change any data, then use read-only cursors. This way you will not waste the resources of the data store.

Deepak Pant
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date