title: Referencing another column in DEFAULT definition in SQL Server 2005
body: <p>I want to define a column in my table with following requirements:</p>
  
  <ol>
  <li>The column should be insertable. If the value is provided in the INSERT statement, then it should be inserted.</li>
  <li>If the column is not referenced in the INSERT statement, then it should be set to the sum of two other columns.</li>
  </ol>
  
  <p>Because of the first requirement, I cannot user computed columns, since they are not insertable. Because of the second, I cannot use DEFAULT, because it doesn't allow referencing other columns in the definition. What other options do I have?</p>
  
  <p>BTW, the column should be NOT NULL.</p>