sqlserver 存储过程的新建与执行
Posted 凌心缘
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sqlserver 存储过程的新建与执行相关的知识,希望对你有一定的参考价值。
if Exists(select * from sysobjects where NAME = ‘insert_custominfo‘ and type=‘P‘) drop procedure insert_custominfo go create proc insert_custominfo @mid nvarchar(50), @custominfoid nvarchar(50) output as begin declare @num int set @num =( select COUNT(*) from t_custominfo where c_id=@mid ) if(@num =0) begin insert into t_custominfo(c_id) values(@mid) set @custominfoid = @@IDENTITY end else begin select @custominfoid=c_custominfoid from t_custominfo where c_id=@mid end end declare @custominfoid int exec insert_custominfo ‘1101‘,@custominfoid output print @custominfoid
以上是关于sqlserver 存储过程的新建与执行的主要内容,如果未能解决你的问题,请参考以下文章