Here is a sample stored procedure and its testing code.
When I run the test code for testing the stored procedure I get the following error.
Cursor with the name ABCD already exists.
Here is the stored procedure
CREATE PROCEDURE HELLOTEST
@IN_VAR NUMERIC
AS
DECLARE ABCD CURSOR
FOR SELECT FIRST FROM TESTTAB
OPEN ABCD
WHILE @@FETCH_STATUS = 0
BEGIN
--I do something
END
GO
Here is the test code
DECLARE @TEST_VAR NUMERIC
SET @TEST_VAR=1
EXECUTE HELLOTEST @TEST_VAR
Now when I run the test code I get the error
Cursor with the name 'ABCD' already exists.
Any suggestions





Reply With Quote