Add a table comment in SQL Server

Source: Internet
Author: User

Today after creating the table, found that there is no way to add comment notes to the table, the field comments can be added when the table, the Internet looked at the use of SQL to add comments to the table method, as follows:

--Table plus CommentsEXECSys.sp_addextendedproperty@name=N'ms_description',@value=N'Comment Content',@level0type=N'SCHEMA',@level0name=N'dbo',@level1type=N'TABLE',@level1name=N'Table name'--For example:EXECSys.sp_addextendedproperty@name=N'ms_description',@value=N'System Setup table',@level0type=N'SCHEMA',@level0name=N'dbo',@level1type=N'TABLE',@level1name=N'Cm01_system'

By the way, note the method of adding comments to a table's fields using SQL as follows:

1 --field plus Comment2 EXECSys.sp_addextendedproperty@name=N'ms_description',@value=N'Comment Content',@level0type=N'SCHEMA',@level0name=N'dbo',@level1type=N'TABLE',@level1name=N'Table name',@level2type=N'COLUMN',@level2name=N'Field name'

Add a table comment in SQL Server

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.