COMMENT ON

Sets a comment on a catalog, schema, table, or view.

To set the comment of a table column, use ALTER TABLE.

Required permissions

If you use Unity Catalog you must have MODIFY permission to set the comment on a VIEW or TABLE, and ownership to set the comment on a SCHEMA or CATALOG.

Syntax

COMMENT ON { CATALOG catalog_name |
             { SCHEMA | DATABASE } schema_name |
             TABLE table_name } IS comment

Parameters

  • catalog_name

    The name of the catalog where your comment appears.

  • schema_name

    The name of the schema where your comment appears.

  • table_name

    The name of the table you comment on. The name must not include a temporal specification.

  • comment

    A STRING literal or NULL. If you specify NULL any existing comment is removed.

Examples

> COMMENT ON CATALOG my_catalog IS 'This is my catalog';

> COMMENT ON SCHEMA my_schema IS 'This is my schema';

> COMMENT ON TABLE my_table IS 'This is my table';

> COMMENT ON TABLE my_table IS NULL;