title: Insert default value when parameter is null
body: <p>I have a table that has a column with a default value:</p>
  
  <pre><code>create table t (
      value varchar(50) default ('something')
  )
  </code></pre>
  
  <p>I'm using a stored procedure to insert values into this table:</p>
  
  <pre><code>create procedure t_insert (
      @value varchar(50) = null
  )
  as 
  insert into t (value) values (@value)
  </code></pre>
  
  <p>The question is, how do I get it to use the default when <code>@value</code> is <code>null</code>?  I tried:</p>
  
  <pre><code>insert into t (value) values ( isnull(@value, default) )
  </code></pre>
  
  <p>That obviously didn't work.  Also tried a <code>case</code> statement, but that didn't fair well either.  Any other suggestions?  Am I going about this the wrong way?</p>
  
  <p>Update: I'm trying to accomplish this <strong>without</strong> having to:</p>
  
  <ol>
  <li>maintain the <code>default</code> value in multiple places, and</li>
  <li>use multiple <code>insert</code> statements.</li>
  </ol>
  
  <p>If this isn't possible, well I guess I'll just have to live with it.  It just seems that something this should be attainable.</p>
  
  <p>Note: my actual table has more than one column.  I was just quickly writing an example.</p>