存儲過程默認參數

create proc test
@inta int,
@intb int=0
as
set nocount on
begin

 return @inta+@intb
end

--demo
declare @intReturnValue int
exec @intReturnValue=test 3
select @intReturnValue

exec @intReturnValue=test 3,2
select @intReturnValue


           
-----------
3

(所影響的行數爲 1 行)

           
-----------
5

(所影響的行數爲 1 行)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章