• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1075
  • Last Modified:

How decrease the sp_cursorfetch ??

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
claesk
Asked:
claesk
1 Solution
 
Ashish PatelCommented:
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
 
OtanaCommented:
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
 
Göran AnderssonCommented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now