Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

how to add new column with default value in sql server

-- Alter tablewith Primary Key constraint

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 #sql #server
ADD COMMENT
Topic
Name
7+7 =