title: How do I set default value for a foreign key column in sql server?
body: <p>I am adding a new column in an existing table with preloaded data. This column uses a primary key from another table and I want to default this to <strong>5</strong>. I have tried the following code: </p>
  
  <pre><code>ALTER TABLE group
  ADD group_type INT
  GO
  ALTER TABLE group
  ADD CONSTRAINT FK_group_type DEFAULT 5 FOR group_type
  GO
  </code></pre>
  
  <p>I was expecting on alter of the <em>group</em> table then all the values will be filled with <strong>5</strong> but instead its NULL. What am I doing wrong?</p>