当前位置:Gxlcms > 数据库问题 > SqlServer 存储过程

SqlServer 存储过程

时间:2021-07-01 10:21:17 帮助过:17人阅读

set Age=Age+1 where ID=1 END

  调用

exec kxy_proc

3.有输入参数

ALTER PROCEDURE kxy_proc
  @id int,
  @name varchar(10)
AS
BEGIN
  update Student set Age=Age+1 where ID=@id and Name=@name
END

  调用

exec kxy_proc 1,kxy

 4.有输出参数

ALTER PROCEDURE kxy_proc
  @id int,
    @age int OUTPUT
AS
BEGIN
  SELECT @age=s.Age from Student s WHERE s.ID=@id;
end

  调用

DECLARE @age int
exec kxy_proc 1,@age OUTPUT
SELECT @age as age

 

SqlServer 存储过程

标签:.com   student   png   har   server   HERE   class   存储   输入参数   

人气教程排行