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 ddc0660 for Add a column with a default value to an existing table in SQL Server

$
0
0
ALTER TABLE <table name> 
ADD <new column name> <data type> NOT NULL
GO
ALTER TABLE <table name> 
ADD CONSTRAINT <constraint name> DEFAULT <default value> FOR <new column name>
GO

Viewing all articles
Browse latest Browse all 91

Trending Articles



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