Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

default column value in sql same as other column

ALTER TABLE tablename ADD newcolumn type NOT NULL DEFAULT (0)
Go
Update tablename SET newcolumn = oldcolumn Where newcolumn = 0
Go
 
PREVIOUS NEXT
Tagged: #default #column #sql #column
ADD COMMENT
Topic
Name
6+9 =