SQL function as default parameter value?
You can try as follow:
Set @CurrentDate=IsNull(@CurrentDate,GetDate())
Default value for stored procedures parameter have to be constants. You'd need to do the following...
ALTER Procedure [dbo].[my_sp]
@currentDate datetime = null
AS
IF @currentDate is null
SET @currentDate = getdate()
I don't think that is possible, you have to use a literal (constant) value as the default.
However you can do this:
Set @currentDate = Coalesce(@currentDate , GetDate())