开发者

How to set default value for a variable in a parameter list

I want the variable to take a default value when a value not passed to开发者_如何学Python a Table valued function.

Could any one please help me do this.


A table valued function with default value for a parameter.

create function GetValue(@Value int = 1) 
returns table as return 
(
  select @Value as ID
)

Use it like this

select *
from dbo.GetValue(default)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜