The default value for a parameter has to be a constant or NULL. You cannot use non-deterministic functions e.g. GETDATE() as default values. The workaround is to declare the default values as a NULL and use a ISNULL or COALESCE function in the procedure body to assign a value to the parameter variable.E.g.create procedure dbo.spMyProc (@d datetime = null)asbeginselect @d = coalesce(@d, getdate()) /*assign a default value*/select @dend
↧