sql 存储过程 output参数的使用

Posted tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 存储过程 output参数的使用相关的知识,希望对你有一定的参考价值。

/*嵌套存储过程中需要输出来的参数*/
output 就是这个存储过程返回的值 也可以说输出的值
--创建存储过程 求最大值
CREATE
PROCEDURE [dbo].[P_Max]
@a int, -- 输入
@b int, -- 输入
@Returnc int output --输出
AS

if (@a>@b)
set @Returnc [email protected]
else
set @Returnc [email protected]

-- 调用
declare @Returnc int
exec P_Max 2,3,@Returnc output
select @Returnc

















以上是关于sql 存储过程 output参数的使用的主要内容,如果未能解决你的问题,请参考以下文章

(c)2006-2024 SYSTEM All Rights Reserved IT常识