July 4, 2011 at 9:41 am
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.
July 4, 2011 at 9:43 am
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.
July 4, 2011 at 10:53 am
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.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply