title: SQL defaults - best practice?
body: <p>What is the best thing to do in the CREATE and UPDATE stored procedures for a table with default constraints?</p>
  
  <p>When I create a new column for a table, I try to set a propper default value (Default constraint).</p>
  
  <p>Example:</p>
  
  <pre><code>CREATE TABLE Orders
  (
     O_ID INT NOT NULL
    ,State INT DEFAULT 0 --  0 =&gt; Not Verified, 1 =&gt; Verified, 2 =&gt; Processing ....
    ,P_ID INT
    ,OrderDate DATE DEFAULT GETDATE()
   )
  </code></pre>
  
  <p>What is the best thing to do in the CREATE and UPDATE stored procedures for this table?
  Use the same defaults as in the constraint?</p>
  
  <pre><code>CREATE PROCEDURE UpdateOrder
  (
     @O_ID INT
    ,@State INT = 0
    ,@P_ID INT
    ,@OrderDate DATE
  )
  AS
  
  UPDATE
     Orders
  SET
     State = @State
    ,P_ID = @PID
    ,OrderDate = @OrderDate
  WHERE
    O_ID = @O_ID
  </code></pre>