Here are the sample scripts show how to write comment on each database object using SQL queries.
Adding comments to a table
-- Adding property to table EXEC sys.sp_addextendedproperty @name = N'MS_Description', @value = N'Customer information.', @level0type = N'SCHEMA', @level0name = 'dbo', @level1type = N'TABLE', @level1name = 'tblCustomer'; GO
Adding comment to column inside table
-- Adding to columns EXEC sp_addextendedproperty @name = N'MS_Description',@value = 'Identity column /Primary key column', @level0type = N'Schema', @level0name = 'dbo', @level1type = N'Table', @level1name = 'tblCustomer', @level2type = N'Column', @level2name = 'CustomerID'; GO
Other Refrence
Pingback: Find all comments in SQL server for all kind of objects Himanshu Patel SQL Server Consultant developer & Administrator -