---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/alter-table.md
cuppy_section: docs
cuppy_doc: EB6H-N0E3
cuppy_doc_uuid: 0f8d7855-940d-438f-8867-559e58129b36
cuppy_permalink: https://cuppy.io/salesforce/d/EB6H-N0E3
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/alter-table
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: cb3ffdecd5dae7c73ce9b5e9371da5c3da0a9fc0942d1f45765251efffaf85fa
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/alter-table.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

## ALTER TABLE

**Applies to:** ❌ Data 360 SQL ✅ Tableau Hyper API

Change the definition of a table.

where `column_constraint` is:

and `table_constraint` is as described in [CREATE TABLE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/create-table.html).

`ALTER TABLE` changes the definition of an existing table. Hyper currently only supports the following changes:

`RENAME`
The `RENAME` forms change the name of a table, the name of an individual column in a table, or the name of a constraint of the table. There is no effect on the stored data.

`ADD COLUMN [ IF NOT EXISTS ]`
This form adds a new column to the table, using the same syntax as [CREATE TABLE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/create-table.html). If `IF NOT EXISTS` is specified and a column already exists with this name, no error is thrown. In contrast to `CREATE TABLE`, which supports any variable-free expression, including non-constant expressions like random(), the default value here must be a constant.

`DROP COLUMN [ IF EXISTS ]`
This form drops a column from a table. Columns with indexes and table constraints can't be dropped.

`ADD table_constraint [ NOT VALID ]`
This form adds a new constraint to a table using the same syntax as [CREATE TABLE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/create-table.html).

Some forms of ALTER TABLE that act on a single table can be combined into a list of multiple alterations to be applied together. It is possible to add several columns and/or drop several columns in a single command. It is also possible to create multiple column constraints in a single command. It is not possible to combine altering columns with adding constraints.

`IF EXISTS`
Do not throw an error if the table does not exist.

`<name>`
The name (optionally schema-qualified) of an existing table to alter.

`<column_name>`
Name of a new or existing column.

`<new_column_name>`
New name for an existing column.

`<new_name>`
New name for the table.

`<data_type>`
Data type of the new column.

The key word `COLUMN` is noise and can be omitted.

Changing any part of a system catalog table is not permitted.

To add a column of type `text` to a table:

To drop a column from a table:

To rename an existing column:

To rename an existing table:

To add an unnamed assumed foreign key constraint to a table:

See [CREATE TABLE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/create-table.html) for more examples of table constraints.


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
