SQL server2008 to Data table, field, add modify comment

Source: Internet
Author: User

1--Table plus annotated 2 EXEC sys.sp_addextendedproperty @name =n ' ms_description ', @value =n ' annotated content ', @level0type =n ' SCHEMA ', @level0name =n ' dbo ', @level1type =n ' table ', @level1name =n ' name ' 3--for example: 4 EXEC sys.sp_addextendedproperty @name =n ' ms_description ', @ Value=n ' System Setup table ', @level0type =n ' SCHEMA ', @level0name =n ' dbo ', @level1type =n ' table ', @level1name =n ' Cm01_system '

  

  

--Add Data field comment Execute sp_addextendedproperty ' ms_description ', ' income floating table ', ' user ', ' dbo ', ' table ', ' com_incomefloat ', ' column ' ', ' RowId ';--Modify data field comment Execute Sp_updateextendedproperty ' ms_description ', ' income floating table ', ' user ', ' dbo ', ' table ', ' com_ Incomefloat ', ' column ', ' RowId '; Ms_description: Proccom_incomefloat of the call: Table name RowId: Field comment for the fields query Selecta.name as TABLE_NAME, B.name as column_name,c.value as Column_descriptionfrom sys.tables ainner JOIN sys.columns B on b.object_id = A.object_idL EFT JOIN sys.extended_properties C on c.major_id = b.object_id and c.minor_id = b.column_idwhere A.name = ' COM_IncomeFloat ‘

  

SQL server2008 to Data table, field, add modify comment

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.