skip to main content
Querying data stores with SQL : Supported SQL and Extensions : Alter Table for Salesforce : Drop Clause: Columns
  

Try Now
Drop Clause: Columns

Purpose

Supported only for Salesforce-based data stores. Use the Drop clause to drop a column from an existing table. This clause is optional.

Syntax

DROP {[COLUMN] column_name}
where:
column_name
Specifies an existing column in an existing table.

Notes

*The column being dropped cannot have a constraint defined on it.
*Drop fails if a SQL view includes the column.

Example

This example drops the status column. For the operation to succeed, the status column cannot have a constraint defined on it and cannot be used in a SQL view.
ALTER TABLE test DROP COLUMN status