Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How decrease the sp_cursorfetch ??

Posted on 2007-11-28
3
1,035 Views
Last Modified: 2011-09-20
Hi,
I have written an application in ASP (with ADO) and an SQL server DB, but the performance is not good. I did run a trace in the SQL-profiler and the first 840 lines are covered with executions of the sp_cursorfetch, sp_cursoroption and sp_cursor stored procedures.

I don't know what causes these problems and I don't know how to solve them. Can someone help me on this?

Kind regards,
K.

PS: I use sometimes filters on recordsets in my ASP code. Is this okay?
0
Comment
Question by:claesk
3 Comments
 
LVL 23

Accepted Solution

by:
Ashish Patel earned 200 total points
ID: 20365002
Its always about the select statements which are using in cursor fetching, so you will have to imporve you indexes on the table where the select statements are used upon and the indexes should be applied mainly on the columns which are frequently used in where clause of the select statemetn.
0
 
LVL 11

Expert Comment

by:Otana
ID: 20365017
If I remember correctly, because you work with recordsets, you get a lot of cursor related commands. The use of cursors slows the system down significantly. To avoid this, you could try moving most of your calculations, record handling, whetever... to a stored procedure (without cursors) on your SQL Server, and then execute the stored procedure by calling it from your ASP code.
0
 
LVL 29

Expert Comment

by:Göran Andersson
ID: 20369566
Those calls comes from working with a recordset that is connected to the server with a server cursor. This happens when you open a recordset that is capable of doing more than you need it to.

If a recordset only reads from the database, you should make sure that it's opened in "firehose" mode, or read-only, forward-only mode.

This is the default mode of a recordset, so you have to have some code that specifies a different mode.

For example, if you have:

objRecset.Open strSQL, objConnection, 3, 3

you just change it to:

objRecset.Open strSQL, objConnection
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question