cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Add comment to multi columns with views

anhbn2707
New Contributor

With Table, I can add comment to multi columns by using: 

ALTER TABLE your_table_name ALTER COLUMN
  col1 COMMENT 'comment1',
  col2 COMMENT 'comment2',
  col3 COMMENT 'comment3';

How can I do with views?

1 REPLY 1

-werners-
Esteemed Contributor III

COMMENT ON COLUMN my_view.column_name IS 'My comment';
Props to Genie Code ๐Ÿ™‚ (I was convinced it was not possible but I was wrong apparently)
This is col by col however.
With CREATE OR REPLACE VIEW you can add all comments in one go though.
You also have to be view owner.