这个存储过程怎么错了?
create procedure sp_getTables
@count int out
as
declare @id2 int , @id3 int
-- declare the cursor1
declare table2 cursor for select [tid] from table2
open table2
-- declare the cursor2
declare table3 cursor for select id from table3
open table3
fetch next from table2 into @id2
WHILE @@FETCH_STATUS = 0
begin
fetch next from table3 into @id3
while @@fetch_status = 0
begin
if @id2 = @id3
@count ++ // 这一行出错
fetch next from table3 into @id3
end
fetch next from table2 into @id2
end
close table2
deallocate table2
close table3
deallocate table3
我写的存储过程怎么错了阿?