Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Fabric - Warehouse + Database - Add syntax to SQL language for comments

Since the foundational format for one lake is the delta file format, why has no SQL syntax for adding comments to both Tables and Columns within tables.

 

With Generative AI, it more important than ever to tag tables and columns with descriptions.

 

Below is the syntax supported by delta files for tables.

 

COMMENT ON TABLE table_name IS 'your desired comment';'

 

Below is the syntax supported by delta files for columns.

 

ALTER TABLE table_name ALTER COLUMN column_name COMMENT 'your desired column comment';

 

Please see vendors like Snowflake (warehousing) and PostgreSQL (database) that have implemented this syntax.  It is alot cleaner than the stored procedure syntax in Fabric SQL database.  Below is the comment on a table.

 

EXEC sp_addextendedproperty 
@name = N'MS_Description',
@value = N'This table contains information about library books on loan, including their ID, book ID, member ID, borrow date, due date, and return date.', 
@level0type = N'SCHEMA', 
@level0name = N'data_raw', 
@level1type = N'TABLE', 
@level1name = N'loans01';

 

Additionally, a comment on a column.

EXEC sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'LoanID', 
@level0type = N'SCHEMA', 
@level0name = N'data_raw', 
@level1type = N'TABLE', 
@level1name = N'loans01',
@level2type = N'COLUMN', 
@level2name = N'The primary key for the loans table.';

 

Status: Under Review
Comments
sukkaur
Microsoft Employee
Status changed to: Under Review