Looking to add a column with default value to an existing table in SQL Server ? Below is an example and sample Data Definition Language Query for achieving the same.
How to Add a Column with Default Value to Existing Table in SQL Server ?
Assume that the table name is “ACEmployee” which already exists and you want to add a new column called “Status” to the table which is of type integer with the default value of 1. Below is the sample T-SQL for adding the column.
ALTER TABLE ACEmployee ADD Status int NULL DEFAULT(1)
Leave a Reply