โ11-19-2023 11:45 AM - edited โ11-19-2023 11:54 AM
I noticed that unlike "Alter Table" there is no "Alter View" command to add comment on a column in the existing view. This is a regular view created on Tables (and not Materialized view).
If the underlying table column has comment then the View inherits it but I want to update that only on View column. I am owner of the tables and View. Has anyone solved this or is this a gap in functionality or bug?
Alternatively ,Is there a way to mass apply or upload column comment on multiple columns across Tables or Views? I have a spreadsheet with column descriptions and want to mass apply /upload in Unity catalog instead of "Alter Table" command for each column
โ11-21-2023 08:24 AM
Thanks, @Retired_mod for the detailed reply. Similar to "Alter Table <name> Alter column <name > comment '<>' " option will there be an option for Views in the future? This will be handy as compared to recreating the Views.
We are currently SQL script to mass-apply ALTER statements. I was hoping any alternative such as excel import/export way
โ11-21-2023 08:24 AM
Thanks, @Retired_mod for the detailed reply. Similar to "Alter Table <name> Alter column <name > comment '<>' " option will there be an option for Views in the future? This will be handy as compared to recreating the Views.
We are currently SQL script to mass-apply ALTER statements. I was hoping any alternative such as excel import/export way
โ02-18-2025 10:04 AM
Use COMMENT ON
COMMENT ON | Databricks on AWS
โ05-28-2025 07:36 AM
Comment On doesn't work with views.
โ10-17-2025 11:07 AM
you can use COMMENT ON to set or update the comment on an view
-- View-level comment (use TABLE for views)
COMMENT ON TABLE catalog.schema.my_view IS 'View for user info';
-- Column-level comment on a view
COMMENT ON COLUMN catalog.schema.my_view.name IS 'User display name';