ALTER TABLE table_name MODIFY column_name datatype NOT NULL;
ALTER TABLE table_name MODIFY COLUMN column_name datatype;
ALTER TABLE DataFlair
ADD emp_id varchar(5);
-- With check if field already exists
IF NOT EXISTS(SELECT 1 FROM sys.columns
WHERE Name = N'Email'
AND Object_ID = Object_ID(N'dbo.Customers'))
BEGIN
ALTER TABLE Customers
ADD Email varchar(255);
END
ALTER TABLE table_name
DROP PRIMARY KEY;
ALTER TABLE table_name
ADD CONSTRAINT MyUniqueConstraint CHECK (CONDITION);
ALTER TABLE table_name
DROP CONSTRAINT MyUniqueConstraint;
ALTER TABLE table_name
ADD CONSTRAINT MyPrimaryKey PRIMARY KEY (column1, column2...);
ALTER TABLE table_name
ADD CONSTRAINT MyUniqueConstraint UNIQUE(column1, column2...);
ALTER TABLE table_name
DROP INDEX MyUniqueConstraint;
how to Alter table in SQL
ALTER TABLE table_name
ADD column_name datatype;