The DEFAULT keyword appears in the following expression, where the parameter is set to the default value.
CREATE PROCEDURE usp_Test @sp_param1 varchar(20) = DEFAULT AS SELECT @sp_param1 AS myTest ;
NULL is assigned to @ sp_param1. But the default value must be a constant or NULL keyword.
Why is the DEFAULT keyword allowed in this situation?
The DEFAULT keyword is a placeholder for something that you want to provide, but is actually not even NULL. Most commonly found in
exec SProcName 2, DEFAULT
, , , DEFAULT .
CREATE PROC, , NULL.