> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Change a Sigma table primary key (Beta)

> Change the primary key columns of a local Sigma table to use different columns to identify rows.

> **Note**
>
> This documentation describes one or more public beta features that are in development. Beta features are subject to quick, iterative changes; therefore the current user experience in the Sigma service can differ from the information provided in this page.
>
> This page should not be considered official published documentation until Sigma removes this notice and the beta flag on the corresponding feature(s) in the Sigma service. For the full beta feature disclaimer, see [Beta features](/docs/sigma-product-releases#beta-features).

When you create a local Sigma table, Sigma automatically generates a new `Id` text column and uses it as the default primary key. This column contains system-generated key values that uniquely identify each row in the table so Sigma can find rows to update or delete when you edit data.

To identify rows using your own data, you can change the primary key to a single text column or multiple text columns that form a composite key.

This page explains how to change the primary key of a local Sigma table. For information about local Sigma tables and how to create them, see [Create local Sigma tables](/docs/create-local-sigma-tables). For general information about Sigma tables, see [Sigma tables overview](/docs/sigma-tables-overview).

> **Info**
>
> Sigma tables are currently supported by Snowflake, Databricks, and PostgreSQL connections.

## Requirements

To change the primary key of a Sigma table:

* The table must be a local Sigma table. You cannot change the primary key of an organization-wide table.
* You must be the owner of the Sigma table (**Can own** access).

## Change the primary key

Choose a column with values that are unique, not null, and stable over time, such as store ID. Avoid dates, timestamps, row numbers, and calculated values that can repeat or change.

When no single column uniquely identifies each row, select multiple columns to create a composite key. For example, store ID might repeat across regions, but the region and store code together identify exactly one store.

1. Open the workbook draft that contains the local Sigma table.

2. Select the local Sigma table element, then open the **Properties** panel to view the data source. A **Local table** badge displays next to the source name.

3. Click the down arrow (![](https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/caret.svg)) next to the data source name, then select **Change primary key column(s)** in the menu.

   ![The Properties panel for a local Sigma table, with the Local table badge next to the data source name and the data source menu open to the Change primary key column(s) option](/_fern-files/_img/ee0a08d59e5368449ccb0b9417de9b178bd1e9f62d20a683ddb8714b37bff159.webp)

4. In the modal, click the **Select the new primary key column(s)** field.

5. In the dropdown, select the checkbox next to each column you want to use as the primary key. Clear the checkbox next to any column you want to remove from the key.

   The dropdown shows all columns in the Sigma table, but you can select only text columns. Other column types cannot be used as the primary key.

   ![The Change primary key modal with the column dropdown open, showing the Id, Store ID, Region ID, and Store name text columns, with Store ID and Region ID selected](/_fern-files/_img/829cef0fe591dd5860aaa281c78647b11c9c9517b9f73d4dbbc4da0037299b5c.webp)

6. Sigma checks for duplicate and null values in the primary key:

   * If Sigma detects duplicate or null values, select different columns or resolve the issue before attempting to change the primary key.
   * If Sigma detects no duplicate or null values, the primary key is valid. Click **Save**.

   ![The Change primary key modal with Store ID and Region ID selected as the new primary key columns, a message that no duplicate or null values were detected, and the Cancel and Save buttons](/_fern-files/_img/2a289202ec0afd708fad61a2f635f1bcb6e94f3e4bee6d3b0c5d44b128bcef1f.webp)

   Sigma changes the primary key in your data platform and locks the local Sigma table to prevent edits while the change is in progress. If Sigma completes the primary key change but you still cannot edit the table, refresh the page and continue editing the data.

## Related resources

* [Sigma tables overview](/docs/sigma-tables-overview)
* [Sigma table architecture](/docs/sigma-table-architecture)
* [Create a local Sigma table](/docs/create-local-sigma-tables)
* [Promote a local Sigma table](/docs/promote-sigma-tables)
* [Edit a Sigma table's data or schema](/docs/edit-sigma-tables)
* [Specify a primary key](/docs/manage-data-catalog#specify-a-primary-key)