In the page, use the extended properties of SQL Server to display comments for columns as access

Source: Internet
Author: User
Tags comments
The Design view of access has a good feature-----design column annotations, which allows the designer to see clearly the meaning of each column. The general SQL Server does not have this function when building a table, but he has extended properties, this function is also good, you can write the comments here, and then the corresponding results as RS back to the page to apply
I think it might be useful to dynamically display the column information of a table in a database (remember as if someone in the Forum had asked before)
The specific method is as follows: (can also be added in Em,qa by right-clicking the corresponding column---extended property)
EXEC sp_addextendedproperty ' crid ', ' Expression id ', ' user ', dbo, ' table ', ' clientinfo ', ' column ', Crid
Go
EXEC sp_addextendedproperty ' names ', ' Show customer names ', ' user ', dbo, ' table ', ' clientinfo ', ' column ', rname
Go
Select Name,value from:: Fn_listextendedproperty
(default, ' user ', ' dbo ', ' table ', ' clientinfo ', ' column ', default)
Go
Name value
---------------------------------------------
Crid Representation ID
People's names show customer names
So you can use it as a result set.
Here it is. System multi-table value function Fn_listextendedpeoperty simply say
Query, because it is a system multiple table value function, so the front must have::
The 1th is to specify the property name----If all is displayed with default or null
第2-7个 parameters, you can see SQL's object naming rules
If default is also specified in all
More Information View Bol
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.