Unanswered: stored procedure default value question
Is there a way inside a stored procedure to determine if a parameter defined with a default value was explicity passed the same value as the default vs. the parameter was omitted and you just got the default value.
E.g. create procedure mysp_stuff @parm1 varchar(20)=NULL, @parm1 bit=0 as
if (@parm1 is null)
-- did we get the default or did the caller pass NULL
if (@parm2 = 0
-- did we get the default or did the caller pass 0
EXEC mysp_stuff @parm1=NULL, @parm2=0