How do I add comments to existing table DDL in Teradata?

oscilatingcretin picture oscilatingcretin · Feb 12, 2013 · Viewed 20.1k times · Source

I am adding some new columns to a table and want to add documentation to the table DDL for future developers. How does one go about this?

Answer

Rob Paller picture Rob Paller · Feb 12, 2013

Generic Syntax:

COMMENT ON {OBJECT} {OBJECTNAME} AS '{255 characters of text};

Detailed Syntax Examples:

COMMENT ON TABLE {DATABASE}.{TABLENAME} AS '{255 characters of text}';
COMMENT ON COLUMN {DATABASENAME}.{TABLENAME}.{COLUMNNAME} AS '{255 characters of text}';
COMMENT ON USER {USERNAME} AS '{255 characters of text}';
COMMENT ON DATABASE {DATABASENAME} AS '{255 characters of text}';