记录下执行带返回值的存储过程
1.定义变量接收返回值@out
2.@tb_product_catalogID = @out 定义返回值用@out接受,标记output
GO
--带返回值的存储过程执行
DECLARE @out INT
EXECUTE dbo.tb_product_catalog_INSERT @name = N'测试', -- nvarchar(100)
@brand_id = 0, -- int
@parent_id = 0, -- int
@custid = 0, -- int
@sort = 0, -- int
@manufacturer_id = 0, -- int
@tb_product_catalogID = @out OUTPUT-- int
PRINT @out
GO
--查看存储过程
sp_helptext tb_product_catalog_INSERT
GO
本文介绍如何在SQL中定义变量接收存储过程的返回值,并通过实例展示了使用@out变量来获取tb_product_catalog_INSERT存储过程的输出结果。
1212

被折叠的 条评论
为什么被折叠?



