CREATE Procedure   xxx as
select top 1 基本信息编号 from 基本信息 order by 基本信息编号 desc
go在查询分析器里执行
exec xxx

解决方案 »

  1.   

    CREATE Procedure   xxx
    (
        @NO int OUTPUT
    )
    ASselect  top 1 @NO =基本信息编号 from 基本信息 order by 基本信息编号 desc
        
    GO
      

  2.   

    create proc xxx
    @no int 
    as 
    select top 1 id from table1 where @no=id order by id desc 
    执行存储过程exec xxx 给出商品编号
      

  3.   

    CREATE Procedure   xxx
    (
        @NO int OUTPUT
    )
    ASselect  top 1 @NO =基本信息编号 from 基本信息 order by 基本信息编号 desc
        
    GO