存储过程

来源:互联网 发布:项目投资价值数据分析 编辑:程序博客网 时间:2024/04/29 12:01

1、建立

 CREATE PROCEDURE mw_jxCh
 @rs char(3) output, --输出参数
 @classID int --输入参数 
AS
 declare @tf char(1) --临时参数
--教学大纲
select @tf=count(*) from jx_DGJH where classID=@classID and type='dg'
if @tf>'0'
select @tf='2'
select @rs=@tf+'00'

 

2、执行

declare @rs char(3)
exec mw_jxch @rs output,@classID=0220002
select @rs

 

注意:建立、执行过程中,输入参数都要在输入函数前面

 

原创粉丝点击