存储过程语法

xiaoxiao2021-02-28  84

create proc 存储过程名

declare @ID int , --输入字段

declare @Num int output  --输出字段

as

begin

  select  @Num  = Count(*)    from 表名 where  ID = @ID

end

执行一次后,调用 存储过程

declare @num int

exec  存储过程名  1,@num output

print @num -- 将条数打印出来

转载请注明原文地址: https://www.6miu.com/read-74429.html

最新回复(0)