> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Documentation for ALTER TABLE ... MODIFY COMMENT which allow adding, modifying, or removing table comments

# ALTER TABLE ... MODIFY COMMENT

Adds, modifies, or removes a table comment, regardless of whether it was set
before or not. The comment change is reflected in both [`system.tables`](/reference/system-tables/tables)
and in the `SHOW CREATE TABLE` query.

<h2 id="syntax">
  Syntax
</h2>

```sql theme={null}
ALTER TABLE [db].name [ON CLUSTER cluster] MODIFY COMMENT 'Comment'
```

<h2 id="examples">
  Examples
</h2>

To create a table with a comment:

```sql title="Query" theme={null}
CREATE TABLE table_with_comment
(
    `k` UInt64,
    `s` String
)
ENGINE = Memory()
COMMENT 'The temporary table';
```

To modify the table comment:

```sql title="Query" theme={null}
ALTER TABLE table_with_comment 
MODIFY COMMENT 'new comment on a table';
```

To view the modified comment:

```sql title="Query" theme={null}
SELECT comment 
FROM system.tables 
WHERE database = currentDatabase() AND name = 'table_with_comment';
```

```text title="Response" theme={null}
┌─comment────────────────┐
│ new comment on a table │
└────────────────────────┘
```

To remove the table comment:

```sql title="Query" theme={null}
ALTER TABLE table_with_comment MODIFY COMMENT '';
```

To verify that the comment was removed:

```sql title="Query" theme={null}
SELECT comment 
FROM system.tables 
WHERE database = currentDatabase() AND name = 'table_with_comment';
```

```text title="Response" theme={null}
┌─comment─┐
│         │
└─────────┘
```

<h2 id="caveats">
  Caveats
</h2>

For Replicated tables, the comment can be different on different replicas.
Modifying the comment applies to a single replica.

The feature is available since version 23.9. It does not work in previous
ClickHouse versions.

<h2 id="related-content">
  Related content
</h2>

* [`COMMENT`](/reference/statements/create/table#comment-clause) clause
* [`ALTER DATABASE ... MODIFY COMMENT`](/reference/statements/alter/database-comment)
