Aqua Data Studio 6.5 を使用して while ループを含むストアド プロシージャを実行しようとしていますが、SP が起動するとすぐに Aqua Data が CPU のメモリを消費し始めます。私が使用しているSybaseサーバー。SP のすべての部分をコメントアウトしてテストし、問題を while ループに絞り込みました。誰が私に何が起こっているのか説明できますか?
create procedure sp_check_stuff as
begin
declare
@counter numeric (9),
@max_id numeric (9),
@exists numeric (1),
@rows numeric (1)
select @max_id = max(id)
from my_table
set @counter = 0
set @exists = 0
set @rows = 0
while @count <= @max_id
begin
//More logic which doesn't affect memory usage based
//on commenting it out and running the SP
set @counter = @counter + 1
set @exists = 0
set @rows = 0
end
end
戻る