overhead for declaring a cursor?

  • Is there an overhead for declaring a cursor? I am looking at an application that declares the cursor and variables, prior to checking if there is any data available to process, then exits afterwards. It runs very frequently on the server, would it be more efficient to do this prior to decaring the cursor.

  • I would run a trace on this (for each completed statement) and then see which one(s) take the most ressources.

    My guess is that untill the open line, the declare takes little to no ressources at all. But this is only a guess.

  • An even more efficient solution might be to replace the c.u.r.s.o.r. *cough* with a set based solution. But we would need much more detailed information to help any further.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply