Quantcast
Channel: How to add a column with a default value to an existing table in SQL Server? - Stack Overflow
Viewing all articles
Browse latest Browse all 91

Answer by Tony L. for Add a column with a default value to an existing table in SQL Server

$
0
0

This can be done in the SSMS GUI as well. I show a default date below but the default value can be whatever, of course.

  1. Put your table in design view (Right click on the table in object explorer->Design)
  2. Add a column to the table (or click on the column you want to update if it already exists)
  3. In Column Properties below, enter (getdate()) or abc or 0 or whatever value you want in Default Value or Binding field as pictured below:

enter image description here


Viewing all articles
Browse latest Browse all 91

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>