存储过程记不住调用次数。
只有建立一个表:
存储过程名,调用次数
每调用一次,就在调用次数上加一,并将此值返回。
return right(str(1000+@cnt),3)

解决方案 »

  1.   

    表:
    create table ProcTime
    (
    PName varchar(50)     not null,
    PTime char(3)         not null
    )存储过程:
    create proc ShowProcTime
    as
    declare @time int
    select @time=cast(PTime as int) from ProcTime
    select @time=@time+1
    update ProcTime set PTime=right(str(1000+@time),3)
    /*查询访问次数*/
    select PTime from ProcTime以上是根据 tj_dns(愉快的登山者)的方法做的,比较简单。
      

  2.   

    还要加上:
    insert into ProcTime values('ShowProcTime','000')
      

  3.   

    insert 表 select isnull(max(编号),0)+1,你要插入的值1,你要插入的值2,你要插入的值3 from 表
      

  4.   


    insert 表 select right('000'+cast(isnull(max(编号),0)+1 as varchar),3),你要插入的值1,你要插入的值2,你要插入的值3 from 表