Available in versions: Dev (3.20) | Latest (3.19) | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11

COMMENT ON VIEW

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

This statement is used to comment on a view.

Dialect support

This example using jOOQ:

commentOnView("view").is("the comment")

Translates to the following dialect specific expressions:

Aurora Postgres, Firebird, Hana, Postgres, Sybase, Teradata, Trino, Vertica, YugabyteDB

COMMENT ON VIEW view IS 'the comment'

BigQuery

ALTER VIEW view SET OPTIONS (DESCRIPTION = 'the comment')

ClickHouse

ALTER TABLE view MODIFY COMMENT 'the comment'

DB2, DuckDB, H2, HSQLDB, Oracle

COMMENT ON TABLE view IS 'the comment'

Snowflake

ALTER VIEW view SET COMMENT = 'the comment'

SQLServer

BEGIN TRY
  DECLARE @u varchar(max) = schema_name();
  EXEC sp_addextendedproperty 'MS_Description', 'the comment', 'schema', @u, 'view', 'view', DEFAULT, DEFAULT
END TRY
BEGIN CATCH
  EXEC sp_updateextendedproperty 'MS_Description', 'the comment', 'schema', @u, 'view', 'view', DEFAULT, DEFAULT
END CATCH

ASE, Access, Aurora MySQL, CockroachDB, Derby, Exasol, Informix, MariaDB, MemSQL, MySQL, Redshift, SQLDataWarehouse, SQLite

/* UNSUPPORTED */
Generated with jOOQ 3.20. Translate your own SQL on our website

References to this page

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo