title: Default null values in stored procedures are not Null
body: <p>I have been testing a faulty procedure, and I realised that the problem is Null values being passed in are not being defaulted to the procedure value...</p>
  
  <pre><code>Create Procedure TestVarcharMaxIsNull
  (@myVar varchar(MAX) = '')
  as
  Select 'Hello' Where @myVar Is Null
  Go
  Exec TestVarcharMaxIsNull Null
  Go
  Exec TestVarcharMaxIsNull ''
  Go
  Exec TestVarcharMaxIsNull 
  Go
  Drop Procedure TestVarcharMaxIsNull
  </code></pre>
  
  <p>Output </p>
  
  <pre><code>Run 1 - "hello"
  Run 2 - ""
  Run 3 - ""
  </code></pre>
  
  <p>I assumed that Null values were defaulted to the value is assigned to in the stored procedure parameter, but this shows if it exists as a parameter it takes the value you pass in. Is there a setting in SQL server that can change this behaviour? </p>