楼主用游标自己取吧。declare  cursor_insert cursor for select c# from cs
declare @i int
open cursor_insert
fetch cursor_insert into @i
while @@fetch_status=0
begin
  print @i
  fetch cursor_insert into @i
end
close cursor_insert
deallocate cursor_insert

解决方案 »

  1.   

    create proc p_test
    as
    declare @a intlb_setp1:
    if Is_Eof(BASIC_DB)=1 returnlb_setp2:
    if Is_Eof(RULE_PRE_DB)=1 goto lb_setp5lb_setp3:
    if dbo.Get_Value(RULE_ACT_DB,rule_name) =dbo.Get_Value(RULE_PRE_DB,rule_name)
    begin
    if dbo.Get_Value(RULE_ACT_DB,num2) =1
    begin
    exec Add_Record BASIC_DB,used,.t.
    exec Add_Record EP_DB,used,.t.
    exec Set_Value(RULE_ACT_DB,active,.t.
    end
    else
    begin
    exec Set_Value RULE_ACT_DB,num2,num2-1
    goto lb_setp3 
    end
    endlb_setp4:
    exec Set_Value RULE_PRE_DB,Active,.t.
    goto lb_setp2lb_setp5:
    exec Set_Value BASIC_DB,Used,.t.  
    goto lb_setp1
    go
      

  2.   

    我觉得将他们合到一块儿,用游标实现,因为在数据库中只能用游标来对某一行记录进行操作,而不用goto语句
      

  3.   

    自己的思想就是都用goto实现,难怪晕,到底是什么应用,放弃goto的分析方法重新分析才是正理。