declare @total money 
execute insert_book '005','SQL Server 2000',400,@total output --加上output
select @total 

解决方案 »

  1.   

    create procedure insert_book 
    @BID varchar(30), 
    @BName varchar(50), 
    @BPrice money, 
    @BSumPrice money output 
    as 
    insert into book values(@BID,@BName,@BPrice) 
    select @BSumPrice=sum(价格) from book 
    go 
    declare @total money 
    execute insert_book '005','SQL Server 2000',400,@total outputselect @total 
      

  2.   

    declare @total money 
    execute insert_book '005','SQL Server 2000',400,@total outputselect @total 给和尚抢了
      

  3.   

    execute insert_book '005','SQL Server 2000',400,@total 
    --->
    execute insert_book '005','SQL Server 2000',400,@total output
      

  4.   

    我怎么刷開的時候還是0回覆,1秒后,就到了6樓,
    CSDN真是太強大了
      

  5.   

    为什么在执行存储过程时也要在上output呀!!!
    execute insert_book '005','SQL Server 2000',400,@total output 
      

  6.   

    加个out关键字
    execute insert_book '005','SQL Server 2000',400,@total out
    select @total 
      

  7.   

    这是语法,不加那么让谁输出呢,输出是要消耗资源的,让大家都输出是不合理的,所以微软规定加output是让输出的,如果他规定用AAA,那你加AAA也能输出
      

  8.   

    感觉不对题,是不是可以这样理解:声明时的output是保留变量的值,只有当调用时output才会将保留的值传出,怎么解释都到不了鼓中间
    大家都很快啊 --大家是快,我太慢,只能看有没有抢丢了什么。