title: Add a column to a table with a default value equal to the value of an existing column
body: <p>How to add a column to a SQL Server table with a default value that is equal to value of an existing column?</p>
  
  <p>I tried this T-SQL statement:</p>
  
  <pre><code>ALTER TABLE tablename 
  ADD newcolumn type NOT NULL DEFAULT (oldcolumn) 
  </code></pre>
  
  <p>but it's giving an error:</p>
  
  <blockquote>
    <p><em>The name "oldcolumn" is not permitted in this context. Valid
    expressions are constants, constant expressions, and (in some
    contexts) variables. Column names are not permitted.</em></p>
  </blockquote>