Partager via


How to: Delete Fields

You can delete a field from a table.

Warning

Deleting a field from a table deletes information about the field, including the field's default value, rule definitions, and caption. If an index key or trigger expression references the field, the expressions become invalid when the field is deleted. The invalid index key or trigger expression does not generate an error until run time.

To delete a field from a table

  1. Open the table in the Table Designer.

  2. On the Fields tab, select the field that you want.

  3. Click Delete.

To delete a field from a table programmatically

  • Use SQL ALTER TABLE command with the DROP COLUMN clause.

For more information, see ALTER TABLE - SQL Command.

For example, the following command deletes a field named Fax from a customer table:

ALTER TABLE Customer DROP COLUMN Fax 

See Also

Tasks

How to: Edit Table Structure

Other Resources

Working with Fields

Working with Tables (Visual FoxPro)