SQL基本操作——存储过程

存储过程类似于C#中的方法。  

--创建存储过程
create proc usp_TwoNumberAdd
@num1 int,
@num2 int
as
begin
    select @num1+@num2
end
--第一种调用方式
declare @n1 int=10,@n2 int=12
exec usp_TwoNumberAdd @num1=@n1,@num2=@n2
--第二种方式直接传值
exec usp_TwoNumberAdd 10,67
原文地址:https://www.cnblogs.com/wuqiuxue/p/7681390.html