There are times when you want to add an column with a default value to the existing table in SQL Server and you can easily do that with the DEFAULT keyword.
How to add a column with a default value to existing table in SQL Server ?
Assume that you want to add a column called “EmploymentStatusID” to the “Employee” table with the default value of 1. Below is the code that demonstrates how to do it.
ALTER TABLE Employee ADD EmploymentStatusID int NOT NULL DEFAULT(1) GO
Enter your email address to subscribe to this blog and receive notifications of new posts by email.