Хочу создать обновляемый курсор, пишу
declare CCUR2 cursor for
select codcip, codcip2, number from @tmp1 order by codcip, codcip2
for update of number
Open CCUR2
while (0=0)
begin
fetch next from CCUR2 into @cip1, @cip2, @count
if(@@FETCH_STATUS <> 0) break
exec sp_GetCountCommon @cip1, @cip2, @count output
update @tmp1 set number = @count where current of CCUR2
end
close CCUR2
deallocate CCUR2
мне говорят:
Server: Msg 16957, Level 16, State 4, Procedure sp_GetMaxNumber, Line 28
FOR UPDATE cannot be specified on a READ ONLY cursor.
Курсор for read only работает успешно.
В чем у меня дело ?