改过来了,还是不行
再帮我瞧瞧好么
create procedure proc_print
@wage money out,
@count int out,@num int out,@money money out
as
set @wage=(select aw.avg_wage
from (select avg(wage) as avg_wage,sex from wage,Employees
where wage.EmployeeID=Employees.EmployeeID and sex='男'
group by sex) as aw)set @count=(select an.sex_wage
from (select count(sex) as sex_wage,sex from wage,Employees
where wage.EmployeeID=Employees.EmployeeID and sex='男'
group by sex) as an)select * from Employees
go
declare @wage money
declare @money money
declare @count int
declare @num intexecute proc_print  @money=@wage out,@num=@count out
print(convert(nvarchar(40),@money))
print(convert(nvarchar(40),@num))

解决方案 »

  1.   

    服务器: 消息 201,级别 16,状态 4,过程 proc_print,行 0
    过程 'proc_print' 需要参数 '@wage',但未提供该参数。
      

  2.   

    服务器: 消息 201,级别 16,状态 4,过程 proc_print,行 0
    过程 'proc_print' 需要参数 '@wage',但未提供该参数。
    第一步存储过程可以建立,这是第二步的错误
      

  3.   

    存储过程不变:
    执行时:declare @wage money
    declare @money money
    declare @count int
    declare @num intexecute proc_print  @wage out,count out,@num out,@money out
    print(convert(nvarchar(40),@wage))
    print(convert(nvarchar(40),@num))
      

  4.   

    alter procedure proc_print
    @wage money out,
    @count int out
    as
    set @wage=(select aw.avg_wage
    from (select avg(wage) as avg_wage,sex from wage,Employees
    where wage.EmployeeID=Employees.EmployeeID and sex='男'
    group by sex) as aw)set @count=(select an.sex_wage
    from (select count(sex) as sex_wage,sex from wage,Employees
    where wage.EmployeeID=Employees.EmployeeID and sex='男'
    group by sex) as an)select * from Employees
    go
    declare @wage money
    declare @count intexecute proc_print  @wage out,@count out
    print(convert(nvarchar(40),@wage))
    print(convert(nvarchar(40),@count))
      

  5.   

    --try
    create procedure proc_print
    @wage money out,
    @count int out,@num int out,@money money out
    as
    set @wage=(select aw.avg_wage
    from (select avg(wage) as avg_wage,sex from wage,Employees
    where wage.EmployeeID=Employees.EmployeeID and sex='男'
    group by sex) as aw)set @count=(select an.sex_wage
    from (select count(sex) as sex_wage,sex from wage,Employees
    where wage.EmployeeID=Employees.EmployeeID and sex='男'
    group by sex) as an)select * from Employees
    go
    declare @wage money
    declare @money money
    declare @count int
    declare @num intexecute proc_print  @wage out,@count out,@num out,@money out
    select (convert(nvarchar(40),@money)),(convert(nvarchar(40),@num))
      

  6.   

    lsqkeke(可可) ( ) 信誉:100 
    您的方法是对的,搞定了,谢谢了