Updated with better solution.
[CURSOR_STATUS][1] .
SQL 2005 TRY...CATCH.
-
BEGIN TRY
DECLARE <cursorName>... CURSOR FOR
...cursor statement, fetch block, close & deallocate
END TRY
BEGIN CATCH
IF (CURSOR_STATUS('global', '<cursorName>') > -2)
DEALLOCATE dbCursor
...other error handling
END CATCH