|
-
Jun 7th, 2000, 01:18 AM
#1
Thread Starter
Fanatic Member
Hi
I have a Stored Procedure with Cursor, I open the cursor out while as:
open cr_Agenda
fetch next from cr_Agenda into @Whr_ini, @Whr_fim,@wlocal,@wnom_loc,@Wccu
while (@@FETCH_STATUS = 0)
begin
<statements>
fetch next from cr_Agenda into @Whr_ini, @Whr_fim,@wlocal,@wnom_loc,@wccu
end
When it read the last row +1 , Where Is wrong ?
Server: Msg 16915, Level 16, State 1, Line -1074292529
A cursor with the name 'cr_Agenda' already exists.
-
Jun 7th, 2000, 09:41 AM
#2
Guru
interesting....I use this code with the Northwind DB in SQL 7 and it works fine:
Code:
CREATE PROCEDURE spu_test AS
declare @MyCustomerID varchar(50)
Declare MyCursor cursor for
select CustomerID from Customers
open MyCursor
fetch next from MyCursor into @MyCustomerID
while (@@FETCH_STATUS = 0)
begin
print @MyCustomerID
fetch next from MyCursor into @MyCustomerID
end
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|