ALTER TABLE Customers
ADD Email varchar(255);
ALTER TABLE dbo.doc_exa
ADD column_b VARCHAR(20) NULL,
column_c INT NULL ;
ALTER TABLE table_name ADD column_name varchar(50);
ALTER TABLE table
ADD COLUMN column VARCHAR (255) NOT NULL AFTER column;
ALTER TABLE table_name
ADD column_name INT -- datatype
-- With default vaue and not nullable
ALTER TABLE table_name
ADD column_name BIT DEFAULT 0 NOT NULL --
ALTER TABLE table_name
ADD column_name datatype;
ALTER TABLE internal_transfer
ADD client_account_id int not null
AFTER id;
-- For More Tutorial, visit NAYCode.com
Alter Table [Table Name] Add [Column Name] [datatype]
ALTER TABLE Customers
ADD phone varchar(10);
ALTER TABLE agents
ADD [associated department] varchar(100)
ALTER TABLE table ADD [COLUMN] column_name;
ALTER TABLE sales.quotations
ADD
amount DECIMAL (10, 2) NOT NULL,
customer_name VARCHAR (50) NOT NULL;
Code language: SQL (Structured Query Language) (sql)
ALTER TABLE table_name
ADD column_name data_type column_constraint
ALTER TABLE table_name
ADD COLUMN column DATA_TYPE;
ALTER TABLE vendors
ADD COLUMN phone VARCHAR(15) AFTER name;
Code language: SQL (Structured Query Language) (sql)