September 3, 2012 at 12:48 am
I am using a cursor inside my store procedure. This store procedure is performing some opertaions on thousands of records..
I am executing this stored procudure manually..
My question:
If i abort this storedprocedure execution in the middle of the process.. what will happens with the cursor....
September 3, 2012 at 1:01 am
Krissh_pallu (9/3/2012)
I am using a cursor inside my store procedure. This store procedure is performing some opertaions on thousands of records..I am executing this stored procudure manually..
My question:
If i abort this storedprocedure execution in the middle of the process.. what will happens with the cursor....
Can you please post your script ?
--rhythmk
------------------------------------------------------------------
To post your question use below link
https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
🙂
September 3, 2012 at 1:27 am
Yes, post your script so someone can show you that you probably don't need to use a CURSOR.
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
September 3, 2012 at 2:28 pm
Krissh_pallu (9/3/2012)
I am using a cursor inside my store procedure. This store procedure is performing some opertaions on thousands of records..I am executing this stored procudure manually..
My question:
If i abort this storedprocedure execution in the middle of the process.. what will happens with the cursor....
It depends. For example, is SQL Server setup for implicit or explicit transactions. Are there any explicit transactions in the code? If so, are they at the row level or at a higher level?
So far as what happens to the actual cursor goes and since I think this might be an interview question, please lookup DEALLOCATE in Books Online. The answer is there.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply