alter table add default sql
snippet in sql

alter table add default sql

user9830

// For SQL Server

ALTER TABLE Persons
ADD CONSTRAINT df_City
DEFAULT 'Sandnes' FOR City;

set default column value sql

user9419

Name Varchar(255) default "Fred"

set default value sql

user1637


CREATE TABLE Persons
(

    ID int NOT NULL,

   
LastName varchar(255) NOT NULL,

   
FirstName varchar(255),

   
Age int,

   
City varchar(255) DEFAULT 'Sandnes'

);