ousoonerjoe
Programmer
Using: SQL 2008 R2
I've come across some old procedures that need error trapping, but have CURSOR(s) in them.
How do I determine the Cursor's state to test if it needs to be closed and/or deallocated from within the CATCH block?
What happens to the Cursor when there is an error or RAISERROR and the stored procedure terminates without closing and deallocating it?
I know they should be completely re-written to get rid of the CURSOR, but unfortunately, is not a viable option at this time. Any suggestions are appreciated. Thank you.
--------------------------------------------------
“Crash programs fail because they are based on the theory that, with nine women pregnant, you can get a baby a month.” --Wernher von Braun
--------------------------------------------------
I've come across some old procedures that need error trapping, but have CURSOR(s) in them.
How do I determine the Cursor's state to test if it needs to be closed and/or deallocated from within the CATCH block?
What happens to the Cursor when there is an error or RAISERROR and the stored procedure terminates without closing and deallocating it?
I know they should be completely re-written to get rid of the CURSOR, but unfortunately, is not a viable option at this time. Any suggestions are appreciated. Thank you.
--------------------------------------------------
“Crash programs fail because they are based on the theory that, with nine women pregnant, you can get a baby a month.” --Wernher von Braun
--------------------------------------------------