作者在 2006-08-25 22:46:00 发布以下内容
一个简单的例子,拿去参考
CREATE procedure Derive_ledger
as
declare @BlockId char(2)
declare bId cursor
for select BlockId
from Blocks
for Read Only
open bId
fetch bId into @BlockId
while @@FETCH_STATUS=0
begin
exec Derive_ledger_1 @BlockId
fetch next from bId
into @BlockId
end
close bId
DEALLOCATE bId
CREATE procedure Derive_ledger
as
declare @BlockId char(2)
declare bId cursor
for select BlockId
from Blocks
for Read Only
open bId
fetch bId into @BlockId
while @@FETCH_STATUS=0
begin
exec Derive_ledger_1 @BlockId
fetch next from bId
into @BlockId
end
close bId
DEALLOCATE bId