一 创建存储过程
1 效果
2 代码
create proc MyPro --创建存储过程,存储过程的名为MyPro
--参数列表
@a int, --整形参数a
@b int, --整形参数b
@sum int output --整形输出参数sum,
as
set @sum = @a+@b --两个输入参数相加后赋值给输出参数
二 执行存储过程
1 效果
2 代码
declare @x int
exec MyPro 1,2,@x output --执行的时候一定要加output,否则不会有结果输出
print @x