Unanswered: Error 16916: A cursor with the name "tentative_cursor" does not exist
I am creating a stored procedure which contains the declaration of a cursor, fetch the cursor, close the cursor, deallocate cursor. I tried executing this code in SQL analyzer and found working. But when I use the same code inside a create stored procedure, it throws the following error message.
Error 16916: A cursor with the name "tentative_cursor" does not exist
As a result, I am not able to proceed in creation of stored procedure with the above SQL statements.
Can any one help me where the problem is..
My SQL statements..
DECLARE tentative_cursor CURSOR
FOR select * from TbTentativeBookingTable where ExpTime < GETDATE()
DECLARE @transactionno BIGINT