<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Add comment to multi columns with views in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/add-comment-to-multi-columns-with-views/m-p/157016#M11781</link>
    <description>&lt;P&gt;For &lt;STRONG&gt;views&lt;/STRONG&gt;, there isn’t a single &lt;STRONG&gt;multi-column&lt;/STRONG&gt; &lt;CODE&gt;ALTER VIEW ... ALTER COLUMN col1 ..., col2 ...&lt;/CODE&gt; form. Update each column &lt;STRONG&gt;one at a time&lt;/STRONG&gt; instead. Databricks supports column comments on views, and newer runtimes/SQL warehouses use &lt;CODE&gt;COMMENT ON COLUMN&lt;/CODE&gt;; older fallback uses &lt;CODE&gt;ALTER TABLE ... ALTER COLUMN ... COMMENT&lt;/CODE&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-sql"&gt;-- Recommended on SQL Warehouse / newer runtimes
COMMENT ON COLUMN catalog.schema.my_view.col1 IS 'comment1';
COMMENT ON COLUMN catalog.schema.my_view.col2 IS 'comment2';
COMMENT ON COLUMN catalog.schema.my_view.col3 IS 'comment3';

-- Older fallback syntax
ALTER TABLE catalog.schema.my_view ALTER COLUMN col1 COMMENT 'comment1';
ALTER TABLE catalog.schema.my_view ALTER COLUMN col2 COMMENT 'comment2';
ALTER TABLE catalog.schema.my_view ALTER COLUMN col3 COMMENT 'comment3';
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you’re &lt;STRONG&gt;creating/replacing&lt;/STRONG&gt; the view, you can also define comments inline in the view column list.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-sql"&gt;CREATE OR REPLACE VIEW catalog.schema.my_view (
  col1 COMMENT 'comment1',
  col2 COMMENT 'comment2',
  col3 COMMENT 'comment3'
) AS
SELECT col1, col2, col3
FROM catalog.schema.source_table;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 May 2026 17:36:26 GMT</pubDate>
    <dc:creator>Lu_Wang_ENB_DBX</dc:creator>
    <dc:date>2026-05-15T17:36:26Z</dc:date>
    <item>
      <title>Add comment to multi columns with views</title>
      <link>https://community.databricks.com/t5/get-started-discussions/add-comment-to-multi-columns-with-views/m-p/156971#M11779</link>
      <description>&lt;P&gt;With Table, I can add comment to multi columns by using:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ALTER TABLE your_table_name ALTER COLUMN
  col1 COMMENT 'comment1',
  col2 COMMENT 'comment2',
  col3 COMMENT 'comment3';&lt;/LI-CODE&gt;&lt;P&gt;How can I do with views?&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 08:03:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/add-comment-to-multi-columns-with-views/m-p/156971#M11779</guid>
      <dc:creator>anhbn2707</dc:creator>
      <dc:date>2026-05-15T08:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Add comment to multi columns with views</title>
      <link>https://community.databricks.com/t5/get-started-discussions/add-comment-to-multi-columns-with-views/m-p/156972#M11780</link>
      <description>&lt;P&gt;COMMENT ON COLUMN my_view.column_name IS 'My comment';&lt;BR /&gt;Props to Genie Code &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; (I was convinced it was not possible but I was wrong apparently)&lt;BR /&gt;This is col by col however.&lt;BR /&gt;With CREATE OR REPLACE VIEW you can add all comments in one go though.&lt;BR /&gt;You also have to be view owner.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 08:16:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/add-comment-to-multi-columns-with-views/m-p/156972#M11780</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2026-05-15T08:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Add comment to multi columns with views</title>
      <link>https://community.databricks.com/t5/get-started-discussions/add-comment-to-multi-columns-with-views/m-p/157016#M11781</link>
      <description>&lt;P&gt;For &lt;STRONG&gt;views&lt;/STRONG&gt;, there isn’t a single &lt;STRONG&gt;multi-column&lt;/STRONG&gt; &lt;CODE&gt;ALTER VIEW ... ALTER COLUMN col1 ..., col2 ...&lt;/CODE&gt; form. Update each column &lt;STRONG&gt;one at a time&lt;/STRONG&gt; instead. Databricks supports column comments on views, and newer runtimes/SQL warehouses use &lt;CODE&gt;COMMENT ON COLUMN&lt;/CODE&gt;; older fallback uses &lt;CODE&gt;ALTER TABLE ... ALTER COLUMN ... COMMENT&lt;/CODE&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-sql"&gt;-- Recommended on SQL Warehouse / newer runtimes
COMMENT ON COLUMN catalog.schema.my_view.col1 IS 'comment1';
COMMENT ON COLUMN catalog.schema.my_view.col2 IS 'comment2';
COMMENT ON COLUMN catalog.schema.my_view.col3 IS 'comment3';

-- Older fallback syntax
ALTER TABLE catalog.schema.my_view ALTER COLUMN col1 COMMENT 'comment1';
ALTER TABLE catalog.schema.my_view ALTER COLUMN col2 COMMENT 'comment2';
ALTER TABLE catalog.schema.my_view ALTER COLUMN col3 COMMENT 'comment3';
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you’re &lt;STRONG&gt;creating/replacing&lt;/STRONG&gt; the view, you can also define comments inline in the view column list.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-sql"&gt;CREATE OR REPLACE VIEW catalog.schema.my_view (
  col1 COMMENT 'comment1',
  col2 COMMENT 'comment2',
  col3 COMMENT 'comment3'
) AS
SELECT col1, col2, col3
FROM catalog.schema.source_table;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 17:36:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/add-comment-to-multi-columns-with-views/m-p/157016#M11781</guid>
      <dc:creator>Lu_Wang_ENB_DBX</dc:creator>
      <dc:date>2026-05-15T17:36:26Z</dc:date>
    </item>
  </channel>
</rss>

