标签: sql-server tsql stored-functions
我有一个带有可选参数的函数,如下所示:
ALTER FUNCTION [dbo].[FN_Foo] ( @P1 AS INT ,@p2 AS INT = 29 )
如何在不传递可选参数的情况下调用它?
select * from [dbo].[FN_Foo] (1)
答案 0 :(得分:0)
您可以调用函数中定义的默认值
select * from [dbo].[FN_Foo] (1, DEFAULT)