Published on: 20 Oct, 2019

How to remove column in sql server using query?

Tumblr Digg Google Plus

In this article, we are going to learn how to remove a table column in SQL Server using the SQL query. To delete a column we can need to use the keyword ALTER to modify the table that we want to delete the column. Then we can use the keyword DROP to remove the column.

Here is the SQL query to remove a column of an existing table in SQL Server.

ALTER TABLE dbo.table_name DROP COLUMN column_name;
One thing to remember, if there is a constraint against the column, you will receive an error message. In order to fix this issue, you need to remove the constraint first.

Comments

There are no comments available.

Write Comment
0 characters entered. Maximum characters allowed are 1000 characters.