As Mitch Wheat it is mentioned that you cannot pass a function.
If in your case you must pass a pre-calculated value or GETDATE () - you can use the default value. For example, modify the stored procedure:
ALTER PROC DisplayDate ( @DateVar DATETIME = NULL ) AS BEGIN set @DateVar=ISNULL(@DateVar,GETDATE())
And then try:
EXEC DisplayDate '2013-02-01 00:00:00.000' EXEC DisplayDate
Note : here I assumed that NULL is not used for this parameter. If this is not your case, you can use another unused value, for example, '1900-01-01 00: 00: 00.000'
Alexander Jul 23 '13 at 12:27 2013-07-23 12:27
source share