Home

SQL Deleting a Column

 

Description

To delete a column in SQL, use the following formula:

ALTER TABLE TableName DROP COLUMN ColumnName;

or

ALTER TABLE TableName
DROP COLUMN ColumnName

Replace the name of the undesired column with the ColumnName factor of our formula. Here is an example:

ALTER TABLE Persons DROP COLUMN FullName

Remember that you can include the statement in the RunSQL() method of the DoCmd class:

Private Sub cmdAlterPersons_Click()
    DoCmd.RunSQL "ALTER TABLE Persons DROP COLUMN FullName"
End Sub
     
 

Home Copyright © 2009-2010 FunctionX, Inc.