This blog explains how to drop a column from a table using T-SQL query. It might be easy to do it from SSMS, on the other side, it is not always convenient to do it from SSMS. When you have to repeat the task of dropping additional columns at a later time, you will have to go back to the object explorer repeatedly and choose those column to be dropped, where as using T-SQL query you just need to change the column name to be dropped. Now let’s look at the script to do it.

ALTER TABLE EmployeeTable
DROP COLUMN Gender 
GO 

 

The Syntax to drop a table column is quite simple, it goes this way “ALTER TABLE YOURTABLENAME DROP COLUMN YOURCOLUMNNAME“.

To use the code in this example, first you will need to create the table EmployeeTable using the script in another blog Creating Primary Key in a SQL Server table

Comments / feedback will be highly appreciated.

–Bru Medishetty