SQL SERVER – ADD/DROP A COLUMN IN A TABLE

How to add and drop a column to a table in SQL SERVER? This is a simple Post and it may help beginners in SQL Server.

  • Add a Column

 ALTER TABLE [TableName] ADD [ColumnName] [DATATYPE]

ALTER TABLE mainschema.testtable ADD [State] INT

  • Drop a Column

ALTER TABLE [TableName] DROP COLUMN [ColumnName]

ALTER TABLE mainschema.testtable DROP COLUMN [State]