Please disable your adblock and script blockers to view this page
 

How to remove column from table in SQL server

Introduction: In previous articles i explained How to delete all tables from Sql server Database  and
and Take automatic backup of Sql server Database and  Copy all data from one table to another in the same database and Copy all data from one database table to another database table and How to concatenate two strings in Sql Server.
In this article i have explained the queries to remove/drop a single or multiple columns from the sql server database table. To do so write the following SQL statement in the SQL server.

Syntax to drop/remove single column:
 alter table TableName drop column ColumnName

Note: Here TableName is the name of the table from where you want to remove the column and ColumnName is the name of the column that you want to remove.

E.g. alter table Tb_Emp drop column Address

Syntax to drop/remove multiple columns:
  alter table TableName drop column ColumnName1, ColumnName2, ColumnName3

Note: Here TableName is the name of the table from where you want to remove the column and ColumnName1, ColumnName2, ColumnName3 are the name of the columns that you want to remove.

E.g. alter table Tb_Emp drop column Address, Country, State


Note: When you delete a column from a table then that column and all the data it contains are deleted from the database and it cannot be undone. So take care while executing this query.

Now over to you:
"If you like my work; you can appreciate by leaving your comments, hitting Facebook like button, following on Google+, Twitter, Linked in and Pinterest, stumbling my posts on stumble upon and subscribing for receiving free updates directly to your inbox . Stay tuned and stay connected for more technical updates."
Previous
Next Post »

If you have any question about any post, Feel free to ask.You can simply drop a comment below post or contact via Contact Us form. Your feedback and suggestions will be highly appreciated. Also try to leave comments from your account not from the anonymous account so that i can respond to you easily.. ConversionConversion EmoticonEmoticon