Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Add a column with a default value to an existing table in SQL Server

ALTER TABLE {TABLENAME} 
ADD {COLUMNNAME} {TYPE} {NULL|NOT NULL} 
CONSTRAINT {CONSTRAINT_NAME} DEFAULT {DEFAULT_VALUE}
WITH VALUES
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Add #column #default #existing #table #SQL #Server
ADD COMMENT
Topic
Name
6+7 =